Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const json = require('./package.json');
Object.keys(json.dependencies).forEach(i => {
if (isInHousePackage(i)) {
json.dependencies[i] = 'next';
}
});
Object.keys(json.devDependencies).forEach(i => {
if (isInHousePackage(i)) {
json.devDependencies[i] = 'next';
}
});
const fs = require('fs');
fs.writeFileSync('./package.json', JSON.stringify(json, null, 2) + '\n');
function isInHousePackage(line) {
const inHousePackages = [
'binary-jwt',
'consul-lb',
'distlock',
'dns-consul',
'game-publisher',
'game-publisher-nexon',
'game-publisher-tencent',
'island',
'island-base',
'island-di',
'island-endpoint-tester',
'island-keeper',
'island-loggers',
'island-status-exporter',
'island-status-transfer',
'mongoose-transaction-plugin',
'redis-bluebird',
'tencent-aas',
'tencent-c4b',
'tencent-dirapi',
'tencent-itc',
'tencent-oidbcomm',
'tencent-sigapi',
'tencent-tss'
];
return inHousePackages.some(p => line.indexOf(p) !== -1);
}
// vim: sw=2 sts=2 ts=2 et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.