Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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'
// 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='
'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'
// 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='
// 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='
// 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'
// - 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'
// 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'
'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='
// - 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='