fs-mode-to-string

0.0.2 • Public • Published

fs-mode-to-string

Create a Unix-like permissions string from an fs.stat file or directory mode, eg 0777to -rwxrwxrwx

Travis Downloads

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'
 

License

MIT

Package Sidebar

Install

npm i fs-mode-to-string

Weekly Downloads

564

Version

0.0.2

License

MIT

Last publish

Collaborators

  • andreaspizsa