How to use the unix-permissions.convert.stat function in unix-permissions

To help you get started, we’ve selected a few unix-permissions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ehmicky / unix-permissions / examples / types / number.js View on Github external
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat(0)) // '---------'

console.log(convert.stat(1)) // '--------x'

console.log(convert.stat(3)) // '-------wx'

console.log(convert.stat(8)) // '-----x---'

console.log(convert.stat(512)) // '--------T'
github ehmicky / unix-permissions / examples / types / octal.js View on Github external
// This file can be directly run:
//   - first install `unix-permissions`
//   - then `node node_modules/unix-permissions/examples/types/octal.js`
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat('720')) // 'rwx-w----'

console.log(convert.stat('7000')) // '--S--S--T'

console.log(convert.stat('\\720')) // 'rwx-w----'

console.log(convert.stat('0720')) // 'rwx-w----'

console.log(convert.stat('0o720')) // 'rwx-w----'

console.log(convert.symbolic('+720')) // 'u+rwx,g+w'

console.log(convert.symbolic('-720')) // 'u-rwx,g-w'

console.log(convert.symbolic('=720')) // 'u=rwx,g=w,o='
github ehmicky / unix-permissions / examples / types / number.js View on Github external
'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat(0)) // '---------'

console.log(convert.stat(1)) // '--------x'

console.log(convert.stat(3)) // '-------wx'

console.log(convert.stat(8)) // '-----x---'

console.log(convert.stat(512)) // '--------T'
github ehmicky / unix-permissions / examples / types / octal.js View on Github external
// Demo of the `octal` permission type in JavaScript.
// This file can be directly run:
//   - first install `unix-permissions`
//   - then `node node_modules/unix-permissions/examples/types/octal.js`
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat('720')) // 'rwx-w----'

console.log(convert.stat('7000')) // '--S--S--T'

console.log(convert.stat('\\720')) // 'rwx-w----'

console.log(convert.stat('0720')) // 'rwx-w----'

console.log(convert.stat('0o720')) // 'rwx-w----'

console.log(convert.symbolic('+720')) // 'u+rwx,g+w'

console.log(convert.symbolic('-720')) // 'u-rwx,g-w'

console.log(convert.symbolic('=720')) // 'u=rwx,g=w,o='
github ehmicky / unix-permissions / examples / types / octal.js View on Github external
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat('720')) // 'rwx-w----'

console.log(convert.stat('7000')) // '--S--S--T'

console.log(convert.stat('\\720')) // 'rwx-w----'

console.log(convert.stat('0720')) // 'rwx-w----'

console.log(convert.stat('0o720')) // 'rwx-w----'

console.log(convert.symbolic('+720')) // 'u+rwx,g+w'

console.log(convert.symbolic('-720')) // 'u-rwx,g-w'

console.log(convert.symbolic('=720')) // 'u=rwx,g=w,o='
github ehmicky / unix-permissions / examples / types / number.js View on Github external
// Demo of the `number` permission type in JavaScript.
// This file can be directly run:
//   - first install `unix-permissions`
//   - then `node node_modules/unix-permissions/examples/types/number.js`
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat(0)) // '---------'

console.log(convert.stat(1)) // '--------x'

console.log(convert.stat(3)) // '-------wx'

console.log(convert.stat(8)) // '-----x---'

console.log(convert.stat(512)) // '--------T'
github ehmicky / unix-permissions / examples / types / number.js View on Github external
//   - then `node node_modules/unix-permissions/examples/types/number.js`
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat(0)) // '---------'

console.log(convert.stat(1)) // '--------x'

console.log(convert.stat(3)) // '-------wx'

console.log(convert.stat(8)) // '-----x---'

console.log(convert.stat(512)) // '--------T'
github ehmicky / unix-permissions / examples / types / number.js View on Github external
// This file can be directly run:
//   - first install `unix-permissions`
//   - then `node node_modules/unix-permissions/examples/types/number.js`
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat(0)) // '---------'

console.log(convert.stat(1)) // '--------x'

console.log(convert.stat(3)) // '-------wx'

console.log(convert.stat(8)) // '-----x---'

console.log(convert.stat(512)) // '--------T'
github ehmicky / unix-permissions / examples / types / octal.js View on Github external
'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat('720')) // 'rwx-w----'

console.log(convert.stat('7000')) // '--S--S--T'

console.log(convert.stat('\\720')) // 'rwx-w----'

console.log(convert.stat('0720')) // 'rwx-w----'

console.log(convert.stat('0o720')) // 'rwx-w----'

console.log(convert.symbolic('+720')) // 'u+rwx,g+w'

console.log(convert.symbolic('-720')) // 'u-rwx,g-w'

console.log(convert.symbolic('=720')) // 'u=rwx,g=w,o='
github ehmicky / unix-permissions / examples / types / octal.js View on Github external
//   - then `node node_modules/unix-permissions/examples/types/octal.js`
// An online demo is also available at:
//   https://repl.it/@ehmicky/unix-permissions

'use strict'

// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')

const { convert } = require('unix-permissions')

console.log(convert.stat('720')) // 'rwx-w----'

console.log(convert.stat('7000')) // '--S--S--T'

console.log(convert.stat('\\720')) // 'rwx-w----'

console.log(convert.stat('0720')) // 'rwx-w----'

console.log(convert.stat('0o720')) // 'rwx-w----'

console.log(convert.symbolic('+720')) // 'u+rwx,g+w'

console.log(convert.symbolic('-720')) // 'u-rwx,g-w'

console.log(convert.symbolic('=720')) // 'u=rwx,g=w,o='