animate/webGl/my-threejs-test/node_modules/lmdb/util/set-optional-deps.cjs

15 lines
569 B
JavaScript
Raw Normal View History

2024-06-24 09:24:00 +00:00
let fs = require('fs');
packageData = JSON.parse(fs.readFileSync('package.json'));
let prebuilds = fs.readdirSync('prebuilds');
let platformDeps = packageData.optionalDependencies = {};
let packageName = packageData.name;
let version = packageData.version;
for (let prebuild of prebuilds) {
platformDeps['@' + packageName + '/' + packageName + '-' + prebuild] = version;
}
/*if (version.endsWith('-v1')) {
packageData.version = version.slice(0, -3);
packageData.name = packageName + '-v1';
}*/
fs.writeFileSync('package.json', JSON.stringify(packageData, null, 2));