Skip to content

Instantly share code, notes, and snippets.

@wolfram77
Created March 20, 2018 18:36
Show Gist options
  • Save wolfram77/90ac8a704a1966dc53beb16eab8d6c20 to your computer and use it in GitHub Desktop.
Save wolfram77/90ac8a704a1966dc53beb16eab8d6c20 to your computer and use it in GitHub Desktop.
NPM

I want to use org repositories for storing individual functions of package.

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