Package Exports
- perms
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (perms) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
perms
Convert Unix style permissions to strings like ls (0755 => 'rwxr-xr-x')
Examples
Given
var perms = require('perms')Convert a mode to a human-readable string like ls(1) generates
var p = perms.toString('0755');
console.log(p);yields
rwxr-xr-xAlso handles special permissions
var p = perms.toString('6660');
console.log(p);yields
rwSrwS---Go backwards as well!
var mode = perms.toMode('rwxr-xr-t');
console.log(mode);yields
1755NOTE: This module makes it super tempting to parse ls(1)... don't do that!
http://mywiki.wooledge.org/ParsingLs
Usage
var perms = require('perms');Functions
toMode(s)
Given a string, return the mode suitable for passing to fs.chmod
toString(s)
Given a mode, return a string suitable for printing to a user
Installation
npm install permsTests
npm testLicense
MIT License