HEX
Server: LiteSpeed
System: Linux server161.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: imagzxcb (1058)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/imagzxcb/public_html/db127a/umask.tar
.npmignore000064400000001113152045563120006542 0ustar00# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript
LICENSE000064400000002065152045563120005557 0ustar00The MIT License (MIT)

Copyright (c) 2015 Sam Mikes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

ChangeLog000064400000000320152045563120006314 0ustar002015-01-15  Sam Mikes  <smikes@cubane.com>

	* index.js: (convert_fromString) accept decimal strings provided they
	don't begin with '0'

2015-01-14  Sam Mikes  <smikes@cubane.com>

	* index.js: initial rev

README.md000064400000003534152045563120006033 0ustar00# umask

Convert umask from string &lt;-> 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 <smikes@cubane.com>

# License

MITpackage.json000064400000002443152045563120007040 0ustar00{
  "_args": [
    [
      "umask@1.1.0",
      "/Users/rebecca/code/npm"
    ]
  ],
  "_from": "umask@1.1.0",
  "_id": "umask@1.1.0",
  "_inBundle": false,
  "_integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=",
  "_location": "/umask",
  "_phantomChildren": {},
  "_requested": {
    "type": "version",
    "registry": true,
    "raw": "umask@1.1.0",
    "name": "umask",
    "escapedName": "umask",
    "rawSpec": "1.1.0",
    "saveSpec": null,
    "fetchSpec": "1.1.0"
  },
  "_requiredBy": [
    "/",
    "/npm