fs-mode-to-string
v0.0.2
Published
Create a Unix-like permissions string from an fs.stat file or directory mode, eg `0777` to `-rwxrwxrwx`
Downloads
1,659
Maintainers
Readme
fs-mode-to-string
Create a Unix-like permissions string from an
fs.stat
file or directorymode
, eg0777
to-rwxrwxrwx
Install
npm i -S fs-mode-to-string
Usage
var fs = require('fs');
var modeString = require('fs-mode-to-string');
// Pass an fs.stat object
var dirMode = fs.statSync('.');
console.log(modeString(dirMode));
// -> 'drwxr--r--'
// Pass an integer
console.log(modeString(0777));
// -> '-rwxrwxrwx'