Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Demo of the `invert()` method in JavaScript.
// This file can be directly run:
// - first install `unix-permissions`
// - then `node node_modules/unix-permissions/examples/methods/invert.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 { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'
const { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'
// This file can be directly run:
// - first install `unix-permissions`
// - then `node node_modules/unix-permissions/examples/methods/invert.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 { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'
// https://repl.it/@ehmicky/unix-permissions
'use strict'
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')
const { positive, invert } = require('unix-permissions')
console.log(positive('o+x,o-rw')) // 'o+x'
console.log(positive('o=x')) // 'o+x'
console.log(positive('660')) // '+0660'
console.log(invert('660')) // '0117'
console.log(invert(positive('660'))) // '-0660'
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')
const { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'
'use strict'
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')
const { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'
// - then `node node_modules/unix-permissions/examples/methods/invert.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 { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'
// https://repl.it/@ehmicky/unix-permissions
'use strict'
// Ignore the following line: this is only needed for internal purposes.
require('../utils.js')
const { invert } = require('unix-permissions')
console.log(invert('u+xs')) // 'u-x'
console.log(invert('u-xs')) // 'u+x'
console.log(invert('u=x')) // 'u+rw,u-x'
console.log(invert('a=x')) // 'a+rw,a-x'
console.log(invert('rws-ws-w-')) // '---r--r-x'
console.log(invert('0660')) // '0117'
console.log(invert('1660')) // '0117'