{"_id":"stat-mode","_rev":"41023","name":"stat-mode","description":"Offers convenient getters and setters for the stat `mode`","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2021-06-03T10:12:23.000Z","created":"2014-03-01T21:44:49.572Z","1.0.0":"2019-11-08T01:23:04.625Z","0.3.0":"2019-03-02T23:51:15.714Z","0.2.2":"2016-09-05T18:49:02.262Z","0.2.1":"2015-04-07T06:27:14.710Z","0.2.0":"2014-04-02T18:57:36.405Z","0.1.0":"2014-03-02T01:00:13.209Z","0.0.1":"2014-03-01T21:44:49.572Z"},"users":{"lokua":true,"diversen":true},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"versions":{"1.0.0":{"name":"stat-mode","version":"1.0.0","description":"Offers convenient getters and setters for the stat `mode`","main":"dist/src/index","typings":"dist/src/index","repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others","chmod","octal","symbolic","permissions"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","devDependencies":{"@types/escodegen":"^0.0.6","@types/esprima":"^4.0.2","@types/mocha":"^5.2.7","@types/node":"^10.5.3","@typescript-eslint/eslint-plugin":"1.6.0","@typescript-eslint/parser":"1.1.0","cpy-cli":"^2.0.0","eslint":"5.16.0","eslint-config-airbnb":"17.1.0","eslint-config-prettier":"4.1.0","eslint-import-resolver-typescript":"1.1.1","eslint-plugin-import":"2.16.0","eslint-plugin-jsx-a11y":"6.2.1","eslint-plugin-react":"7.12.4","mocha":"^6.2.0","rimraf":"^3.0.0","typescript":"^3.5.3"},"engines":{"node":">= 6"},"scripts":{"prebuild":"rimraf dist","build":"tsc","postbuild":"cpy --parents src test '!**/*.ts' dist","test":"mocha --reporter spec dist/test/test*.js","test-lint":"eslint src --ext .js,.ts","prepublishOnly":"npm run build"},"gitHead":"72ea3525bd5f92781de3cefac09c047df397e779","_id":"stat-mode@1.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"shasum":"68b55cb61ea639ff57136f36b216a291800d1465","size":6189,"noattachment":false,"key":"/stat-mode/-/stat-mode-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-1.0.0.tgz"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stat-mode_1.0.0_1573176184521_0.34221609334493763"},"_hasShrinkwrap":false,"publish_time":1573176184625,"_cnpm_publish_time":1573176184625},"0.3.0":{"name":"stat-mode","version":"0.3.0","description":"Offers convenient getters and setters for the stat `mode`","main":"index.js","repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others","chmod","octal","symbolic","permissions"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","devDependencies":{"mocha":"^3.0.2"},"scripts":{"test":"mocha --reporter spec"},"gitHead":"a5688ac6d9002ad4fe3f59659a09b8a9e6697460","_id":"stat-mode@0.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"dist":{"shasum":"69283b081f851582b328d2a4ace5f591ce52f54b","size":5626,"noattachment":false,"key":"/stat-mode/-/stat-mode-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-0.3.0.tgz"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stat-mode_0.3.0_1551570675553_0.3290466284861371"},"_hasShrinkwrap":false,"publish_time":1551570675714,"_cnpm_publish_time":1551570675714},"0.2.2":{"name":"stat-mode","version":"0.2.2","description":"Offers convenient getters and setters for the stat `mode`","main":"index.js","repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others","chmod","octal","symbolic","permissions"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","devDependencies":{"mocha":"^3.0.2"},"scripts":{"test":"mocha --reporter spec"},"gitHead":"c5fda09e051af3b314d18a72d41571f548da3700","_id":"stat-mode@0.2.2","_shasum":"e6c80b623123d7d80cf132ce538f346289072502","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"dist":{"shasum":"e6c80b623123d7d80cf132ce538f346289072502","size":4980,"noattachment":false,"key":"/stat-mode/-/stat-mode-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-0.2.2.tgz"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stat-mode-0.2.2.tgz_1473101340561_0.20689093857072294"},"directories":{},"publish_time":1473101342262,"_cnpm_publish_time":1473101342262,"_hasShrinkwrap":false},"0.2.1":{"name":"stat-mode","version":"0.2.1","description":"Offers convenient getters and setters for the stat `mode`","main":"index.js","repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others","chmod","octal","symbolic","permissions"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","devDependencies":{"mocha":"~1.18.2"},"scripts":{"test":"mocha --reporter spec"},"gitHead":"e4d6f1dc65c2a5d47549143fe8f0f198eeab939f","_id":"stat-mode@0.2.1","_shasum":"d714e08a4ed157089c1340f76fee54046c8242d6","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.1","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"d714e08a4ed157089c1340f76fee54046c8242d6","size":4671,"noattachment":false,"key":"/stat-mode/-/stat-mode-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-0.2.1.tgz"},"directories":{},"publish_time":1428388034710,"_cnpm_publish_time":1428388034710,"_hasShrinkwrap":false},"0.2.0":{"name":"stat-mode","version":"0.2.0","description":"Offers convenient getters and setters for the stat `mode`","main":"index.js","repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","devDependencies":{"mocha":"^1.17.1"},"scripts":{"test":"mocha --reporter spec"},"_id":"stat-mode@0.2.0","dist":{"shasum":"eb0bf1e36eed1a0f57223ce2ab345920af66502d","size":3938,"noattachment":false,"key":"/stat-mode/-/stat-mode-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1396465056405,"_cnpm_publish_time":1396465056405,"_hasShrinkwrap":false},"0.1.0":{"name":"stat-mode","version":"0.1.0","description":"Offers convenient getters and setters for the stat `mode`","main":"index.js","repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","_id":"stat-mode@0.1.0","dist":{"shasum":"0cfbec3af29e6059122d2f7efc3e96a8203556a9","size":3008,"noattachment":false,"key":"/stat-mode/-/stat-mode-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1393722013209,"_cnpm_publish_time":1393722013209,"_hasShrinkwrap":false},"0.0.1":{"name":"stat-mode","version":"0.0.1","description":"Offers convenient getters and setters for the stat `mode`","main":"index.js","scripts":{"test":"mocha --reporter spec"},"repository":{"type":"git","url":"git://github.com/TooTallNate/stat-mode.git"},"keywords":["stat","mode","owner","group","others"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"homepage":"https://github.com/TooTallNate/stat-mode","_id":"stat-mode@0.0.1","dist":{"shasum":"6f8b1d46f007c78775d341de35fc7a1c1003dff3","size":2479,"noattachment":false,"key":"/stat-mode/-/stat-mode-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stat-mode/download/stat-mode-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"directories":{},"publish_time":1393710289572,"_cnpm_publish_time":1393710289572,"_hasShrinkwrap":false}},"readme":"stat-mode\n=========\n### Offers convenient getters and setters for the stat `mode`\n[![Build Status](https://github.com/TooTallNate/stat-mode/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/stat-mode/actions?workflow=Node+CI)\n\nYou know that `mode` property on the `fs.Stat` object that you probably\nusually just ignore? Well there's acutally a lot of information packed\ninto that number.\n\nThe specific information includes:\n\n * What the [\"file type\"](http://en.wikipedia.org/wiki/Unix_file_types) of file it is\n * Whether or not the [`setuid` and `setgid` bits](http://en.wikipedia.org/wiki/Setuid) are set\n * Whether or not the [`sticky` bit](http://en.wikipedia.org/wiki/Sticky_bit) is set\n * The [_read_, _write_, and _execute_ permissions for the _owner_, _group_ and _others_](http://en.wikipedia.org/wiki/File_system_permissions)\n\nThis module helps you extract that information.\n\nAll the getters are also setters, which change the `mode` property\nappropriately. This is useful for when you have to build up your\nown `fs.Stat` object for whatever reason (like when implementing a\nFUSE filesystem.\n\n\nInstallation\n------------\n\n``` bash\n$ npm install stat-mode\n```\n\n\nExample\n-------\n\nSo given some arbitrary file (let's say `/bin/echo`):\n\n``` bash\n$ ls -l /bin/echo\n-rwxr-xr-x 1 root wheel 14128 Aug 11  2013 /bin/echo\n```\n\nWe can inspect it using the `fs.stat()` call and creating a `Mode` instance\non top of it.\n\n``` javascript\nvar fs = require('fs');\nvar Mode = require('stat-mode');\n\nfs.stat('/bin/echo', function (err, stat) {\n  if (err) throw err;\n\n  // create a \"Mode\" instance on top of the `stat` object\n  var mode = new Mode(stat);\n\n  // you can check what kind of file it is:\n  mode.isDirectory();\n  // false\n\n  mode.isFIFO();\n  // false\n\n  mode.isFile();\n  // true\n\n\n  // and you can also check individual owner, group and others permissions\n  mode.owner.read;\n  // true\n\n  mode.owner.write;\n  // true\n\n  mode.owner.execute;\n  // true\n\n  mode.group.read;\n  // true\n\n  mode.group.write;\n  // false\n\n  mode.group.execute;\n  // true\n\n  mode.others.read;\n  // true\n\n  mode.others.write;\n  // false\n\n  mode.others.execute;\n  // true\n\n\n  // the `toString()` output resembes the `ls -l` output:\n  mode.toString();\n  // '-rwxr-xr-x'\n});\n```\n\n\nAPI\n---\n\n### new Mode(Object stat) → Mode\n\nYou must pass in \"stat\" object to the `Mode` constructor. The \"stat\"\nobject can be a real `fs.Stat` instance, or really any Object with a\n`mode` property.\n\n#### mode.isDirectory([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"directory\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"directory\".\n\n#### mode.isFile([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"file\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"file\".\n\n#### mode.isBlockDevice([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"block device\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"block device\".\n\n#### mode.isCharacterDevice([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"character device\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"character\ndevice\".\n\n#### mode.isSymbolicLink([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"symbolic link\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"symbolic link\".\n\n#### mode.isFIFO([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"FIFO\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"FIFO\".\n\n#### mode.isSocket([Boolean set]) → Boolean\n\nReturns `true` if the mode's file type is \"socket\", `false` otherwise.\nIf you pass `true` to the function, then the mode will be set to \"socket\".\n\n#### mode.owner.read → Boolean [Getter/Setter]\n\n`true` if the mode is \"owner read\" rights, `false` otherwise.\n\n#### mode.owner.write → Boolean [Getter/Setter]\n\n`true` if the mode is \"owner write\" rights, `false` otherwise.\n\n#### mode.owner.execute → Boolean [Getter/Setter]\n\n`true` if the mode is \"owner execute\" rights, `false` otherwise.\n\n#### mode.group.read → Boolean [Getter/Setter]\n\n`true` if the mode is \"group read\" rights, `false` otherwise.\n\n#### mode.group.write → Boolean [Getter/Setter]\n\n`true` if the mode is \"group write\" rights, `false` otherwise.\n\n#### mode.group.execute → Boolean [Getter/Setter]\n\n`true` if the mode is \"group execute\" rights, `false` otherwise.\n\n#### mode.others.read → Boolean [Getter/Setter]\n\n`true` if the mode is \"others read\" rights, `false` otherwise.\n\n#### mode.others.write → Boolean [Getter/Setter]\n\n`true` if the mode is \"others write\" rights, `false` otherwise.\n\n#### mode.others.execute → Boolean [Getter/Setter]\n\n`true` if the mode is \"others execute\" rights, `false` otherwise.\n","_attachments":{},"homepage":"https://github.com/TooTallNate/stat-mode","bugs":{"url":"https://github.com/TooTallNate/stat-mode/issues"},"license":"MIT"}