I want to use org repositories for storing individual functions of package.
Created
March 20, 2018 18:36
-
-
Save wolfram77/90ac8a704a1966dc53beb16eab8d6c20 to your computer and use it in GitHub Desktop.
NPM
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
const fs = require('fs'); | |
const os = require('os'); | |
const cp = require('child_process'); | |
var pre = 'number-'; | |
var org = '@number-extra/'; | |
var dir = process.argv[2]||'.'; | |
var pkg = JSON.parse(fs.readFileSync(dir+'/package.json')); | |
pkg.name = org+pkg.name.replace(pre, ''); | |
pkg.keywords.push('extra'); | |
fs.writeFileSync(dir+'/package.json', JSON.stringify(pkg, null, 2)); | |
var rdm = fs.readFileSync(dir+'/README.md'); | |
rdm.replace(new RegExp(pre, 'g'), org); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment