{"_id":"umask","_rev":"10-ff883423988dc1024d057917157ba8b4","name":"umask","description":"convert umask from string <-> number","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"umask","version":"1.0.0","description":"convert umask from string <-> number","main":"index.js","scripts":{"test":"lab -ct 100","lint":"jslint --terse --latest *.js test/*.js"},"repository":{"type":"git","url":"https://github.com/smikes/umask.git"},"keywords":["umask"],"author":{"name":"Sam Mikes","email":"smikes@cubane.com"},"license":"MIT","bugs":{"url":"https://github.com/smikes/umask/issues"},"homepage":"https://github.com/smikes/umask","devDependencies":{"code":"^1.2.1","jslint":"^0.7.2","lab":"^5.2.0"},"gitHead":"c619971253c3cfc97a8d876575dd1a97b8210897","_id":"umask@1.0.0","_shasum":"e6ba9ef654cebc90f91290b661f196db9932d11f","_from":".","_npmVersion":"2.2.0","_nodeVersion":"0.10.35","_npmUser":{"name":"smikes","email":"smikes@cubane.com"},"maintainers":[{"name":"smikes","email":"smikes@cubane.com"}],"dist":{"shasum":"e6ba9ef654cebc90f91290b661f196db9932d11f","tarball":"https://registry.npmjs.org/umask/-/umask-1.0.0.tgz","integrity":"sha512-ZWjdDizdW9G0susM0jDbgW4UZ8qzJxok6Y+Qq+Gu4g2QHaiuumEJ213iCRt//2oU2yx4AHHnyi9yiijpBVLcTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCw2VW9HWvBJeZYdiyVwnljTYL4Xbu8/w6t4bME7RgaLAIhANIoWn1o+sfIXUHTwcV91wHmdwdhh4eHiuhSoQhaf1ON"}]}},"1.1.0":{"name":"umask","version":"1.1.0","description":"convert umask from string <-> number","main":"index.js","scripts":{"test":"lab -ct 100","lint":"jslint --terse --latest *.js test/*.js"},"repository":{"type":"git","url":"https://github.com/smikes/umask.git"},"keywords":["umask"],"author":{"name":"Sam Mikes","email":"smikes@cubane.com"},"license":"MIT","bugs":{"url":"https://github.com/smikes/umask/issues"},"homepage":"https://github.com/smikes/umask","devDependencies":{"code":"^1.2.1","jslint":"^0.7.2","lab":"^5.2.0"},"gitHead":"63d821e4d0b06ef9a4b727c5fbe5976e9534d76e","_id":"umask@1.1.0","_shasum":"f29cebf01df517912bb58ff9c4e50fde8e33320d","_from":".","_npmVersion":"2.2.0","_nodeVersion":"0.10.35","_npmUser":{"name":"smikes","email":"smikes@cubane.com"},"maintainers":[{"name":"smikes","email":"smikes@cubane.com"}],"dist":{"shasum":"f29cebf01df517912bb58ff9c4e50fde8e33320d","tarball":"https://registry.npmjs.org/umask/-/umask-1.1.0.tgz","integrity":"sha512-lE/rxOhmiScJu9L6RTNVgB/zZbF+vGC0/p6D3xnkAePI2o0sMyFG966iR5Ki50OI/0mNi2yaRnxfLsPmEZF/JA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGtwHg4m+cEya4becZvVfNyIy2pMQdwttY+vX919so9AiEAkiW8VSis2bTpF0kZqV+PCQ1YQnQYNwO0hd0pqz8xzrE="}]}}},"readme":"# umask\n\nConvert umask from string &lt;-> number.\n\n## Installation & Use\n\n```\n$ npm install -S umask\n\nvar umask = require('umask');\n\nconsole.log(umask.toString(18));        // 0022\n\nconsole.log(umask.fromString('0777'))   // 511\n```\n\n## API\n\n### `toString( val )`\n\nConverts `val` to a 0-padded octal string.  `val` is assumed to be a\nNumber in the correct range (0..511)\n\n### `fromString( val, [cb] )`\n\nConverts `val` to a Number that can be used as a umask.  `val` can\nbe of the following forms:\n\n  * String containing octal number (leading 0)\n  * String containing decimal number\n  * Number\n\nIn all cases above, the value obtained is then converted to an integer and\nchecked against the legal `umask` range 0..511\n\n`fromString` can be used as a simple converter, with no error feedback, by\nomitting the optional callback argument `cb`:\n\n```\n   var mask = umask.fromString(val);\n\n   // mask is now the umask descibed by val or\n   // the default, 0022 (18 dec)\n```\n\nThe callback arguments are `(err, val)` where `err` is either `null` or an\nError object and `val` is either the converted umask or the default umask, `0022`.\n\n```\n   umask.fromString(val, function (err, val) {\n       if (err) {\n          console.error(\"invalid umask: \" + err.message)\n       }\n\n       /* do something with val */\n   });\n```\n\nThe callback, if provided, is always called **synchronously**.\n\n### `validate( data, k, val )`\n\nThis is a validation function of the form expected by `nopt`.  If\n`val` is a valid umask, the function returns true and sets `data[k]`.\nIf `val` is not a valid umask, the function returns false.\n\nThe `validate` function is stricter than `fromString`: it only accepts\nNumber or octal String values, and the String value must begin with `0`.\nThe `validate` function does **not** accept Strings containing decimal\nnumbers.\n\n# Maintainer\n\nSam Mikes <smikes@cubane.com>\n\n# License\n\nMIT","maintainers":[{"email":"smikes@cubane.com","name":"smikes"},{"email":"ogd@aoaioxxysz.net","name":"othiym23"},{"email":"i@izs.me","name":"isaacs"}],"time":{"modified":"2022-06-28T03:47:14.541Z","created":"2015-01-15T03:06:07.758Z","1.0.0":"2015-01-15T03:06:07.758Z","1.1.0":"2015-01-15T12:47:12.246Z"},"homepage":"https://github.com/smikes/umask","keywords":["umask"],"repository":{"type":"git","url":"https://github.com/smikes/umask.git"},"author":{"name":"Sam Mikes","email":"smikes@cubane.com"},"bugs":{"url":"https://github.com/smikes/umask/issues"},"license":"MIT","readmeFilename":"README.md","users":{"mattmcfarland":true}}