quick npm owner add
Last active
July 27, 2017 09:51
-
-
Save atian25/cf7d4b282f570d857b8fee86856a0abf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const assert = require('assert'); | |
const { execSync } = require('child_process'); | |
const pkg = process.argv[2]; | |
assert(pkg, 'Usage: npx <package name>'); | |
run(`npm owner ls ${pkg}`); | |
[ 'fengmk2', 'popomore', 'dead_horse' ].forEach(user => { | |
run(`npm owner add ${user} ${pkg}`); | |
}); | |
run(`npm owner ls ${pkg}`); | |
console.log('\nDone.'); | |
function run(cmd) { | |
console.log('\x1b[33m➜ %s\x1b[0m',cmd); | |
execSync(cmd, { stdio: 'inherit' }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "egg-npm-owner", | |
"version": "1.0.0", | |
"bin": "./index.js" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment