Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')
const { convert, positive } = require('unix-permissions')
console.log(convert.symbolic('111')) // 'a=x'
console.log(positive(convert.symbolic('111'))) // 'a+x'
console.log(convert.octal('o+x')) // '+0001'
console.log(convert.octal('o=x')) // '0001'
try {
convert.octal('z+x') // Throws an exception (permission syntax is invalid)
} catch (error) {
console.log(error.message)
}
// Demo of the `stat` permission type in JavaScript.
// This file can be directly run:
// - first install `unix-permissions`
// - then `node node_modules/unix-permissions/examples/types/stat.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.octal('--------x')) // '0001'
console.log(convert.octal('--x--x--x')) // '0111'
console.log(convert.octal('--------T')) // '1000'
console.log(convert.octal('--------t')) // '1001'
console.log(convert.octal('d--------x')) // '0001'
console.log(convert.octal('--x --x --x')) // '0111'
console.log(convert.octal('rwx --- ---')) // '0700'
console.log(convert.octal('xwr --- ---')) // '0700'
const { convert } = require('unix-permissions')
console.log(convert.octal('--------x')) // '0001'
console.log(convert.octal('--x--x--x')) // '0111'
console.log(convert.octal('--------T')) // '1000'
console.log(convert.octal('--------t')) // '1001'
console.log(convert.octal('d--------x')) // '0001'
console.log(convert.octal('--x --x --x')) // '0111'
console.log(convert.octal('rwx --- ---')) // '0700'
console.log(convert.octal('xwr --- ---')) // '0700'
// https://repl.it/@ehmicky/unix-permissions
'use strict'
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')
const { convert, positive } = require('unix-permissions')
console.log(convert.symbolic('111')) // 'a=x'
console.log(positive(convert.symbolic('111'))) // 'a+x'
console.log(convert.octal('o+x')) // '+0001'
console.log(convert.octal('o=x')) // '0001'
try {
convert.octal('z+x') // Throws an exception (permission syntax is invalid)
} catch (error) {
console.log(error.message)
}
// 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.octal('--------x')) // '0001'
console.log(convert.octal('--x--x--x')) // '0111'
console.log(convert.octal('--------T')) // '1000'
console.log(convert.octal('--------t')) // '1001'
console.log(convert.octal('d--------x')) // '0001'
console.log(convert.octal('--x --x --x')) // '0111'
console.log(convert.octal('rwx --- ---')) // '0700'
console.log(convert.octal('xwr --- ---')) // '0700'
// 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.octal('o+wx')) // '+0003'
console.log(convert.octal('o=wx')) // '0003'
console.log(convert.octal('o-wx')) // '-0003'
console.log(convert.octal('go+x')) // '+0011'
console.log(convert.octal('g+x,o+x')) // '+0011'
console.log(convert.octal('a+x')) // '+0111'
console.log(convert.octal('+x')) // '+0111'
console.log(convert.octal('a+s')) // '+6000'
console.log(convert.octal('o+')) // '+0000'
// This file can be directly run:
// - first install `unix-permissions`
// - then `node node_modules/unix-permissions/examples/types/symbolic.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.octal('o+wx')) // '+0003'
console.log(convert.octal('o=wx')) // '0003'
console.log(convert.octal('o-wx')) // '-0003'
console.log(convert.octal('go+x')) // '+0011'
console.log(convert.octal('g+x,o+x')) // '+0011'
console.log(convert.octal('a+x')) // '+0111'
console.log(convert.octal('+x')) // '+0111'
console.log(convert.octal('a+s')) // '+6000'
console.log(convert.octal('o+')) // '+0000'
console.log(convert.octal('o+wx')) // '+0003'
console.log(convert.octal('o=wx')) // '0003'
console.log(convert.octal('o-wx')) // '-0003'
console.log(convert.octal('go+x')) // '+0011'
console.log(convert.octal('g+x,o+x')) // '+0011'
console.log(convert.octal('a+x')) // '+0111'
console.log(convert.octal('+x')) // '+0111'
console.log(convert.octal('a+s')) // '+6000'
console.log(convert.octal('o+')) // '+0000'
// - then `node node_modules/unix-permissions/examples/types/stat.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.octal('--------x')) // '0001'
console.log(convert.octal('--x--x--x')) // '0111'
console.log(convert.octal('--------T')) // '1000'
console.log(convert.octal('--------t')) // '1001'
console.log(convert.octal('d--------x')) // '0001'
console.log(convert.octal('--x --x --x')) // '0111'
console.log(convert.octal('rwx --- ---')) // '0700'
console.log(convert.octal('xwr --- ---')) // '0700'
// This file can be directly run:
// - first install `unix-permissions`
// - then `node node_modules/unix-permissions/examples/types/stat.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.octal('--------x')) // '0001'
console.log(convert.octal('--x--x--x')) // '0111'
console.log(convert.octal('--------T')) // '1000'
console.log(convert.octal('--------t')) // '1001'
console.log(convert.octal('d--------x')) // '0001'
console.log(convert.octal('--x --x --x')) // '0111'
console.log(convert.octal('rwx --- ---')) // '0700'
console.log(convert.octal('xwr --- ---')) // '0700'