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