X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Fumask%2FREADME.md;fp=org.simantics.maps.server%2Fnode%2Fnode-v4.8.0-win-x64%2Fnode_modules%2Fnpm%2Fnode_modules%2Fumask%2FREADME.md;h=80009ae709b2c5cc9a7468a63ed0fe9b701bfd60;hb=2529be6d456deeb07c128603ce4971f1dc29b695;hp=0000000000000000000000000000000000000000;hpb=2636fc31c16c23711cf2b06a4ae8537bba9c1d35;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/README.md new file mode 100644 index 00000000..80009ae7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/README.md @@ -0,0 +1,78 @@ +# umask + +Convert umask from string <-> number. + +## Installation & Use + +``` +$ npm install -S umask + +var umask = require('umask'); + +console.log(umask.toString(18)); // 0022 + +console.log(umask.fromString('0777')) // 511 +``` + +## API + +### `toString( val )` + +Converts `val` to a 0-padded octal string. `val` is assumed to be a +Number in the correct range (0..511) + +### `fromString( val, [cb] )` + +Converts `val` to a Number that can be used as a umask. `val` can +be of the following forms: + + * String containing octal number (leading 0) + * String containing decimal number + * Number + +In all cases above, the value obtained is then converted to an integer and +checked against the legal `umask` range 0..511 + +`fromString` can be used as a simple converter, with no error feedback, by +omitting the optional callback argument `cb`: + +``` + var mask = umask.fromString(val); + + // mask is now the umask descibed by val or + // the default, 0022 (18 dec) +``` + +The callback arguments are `(err, val)` where `err` is either `null` or an +Error object and `val` is either the converted umask or the default umask, `0022`. + +``` + umask.fromString(val, function (err, val) { + if (err) { + console.error("invalid umask: " + err.message) + } + + /* do something with val */ + }); +``` + +The callback, if provided, is always called **synchronously**. + +### `validate( data, k, val )` + +This is a validation function of the form expected by `nopt`. If +`val` is a valid umask, the function returns true and sets `data[k]`. +If `val` is not a valid umask, the function returns false. + +The `validate` function is stricter than `fromString`: it only accepts +Number or octal String values, and the String value must begin with `0`. +The `validate` function does **not** accept Strings containing decimal +numbers. + +# Maintainer + +Sam Mikes + +# License + +MIT \ No newline at end of file