multipassify-ts
Version:
This is an example TypeScript Package ready to be published on npm. It has been set up with automated tests and package publishing workflow using GitHub Actions CI/CD. It is made primarily for GitHub + VS Code (Windows / Mac / Linux) users who are about t
26 lines (22 loc) • 498 B
JavaScript
/* eslint-disable */
const fs = require('fs')
const Path = require('path')
const fileName = '../package.json'
const file = require(fileName)
/* eslint-enable */
const args = process.argv.slice(2)
for (let i = 0, l = args.length; i < l; i++) {
if (i % 2 === 0) {
file[args[i]] = args[i + 1]
}
}
fs.writeFile(
Path.join(__dirname, fileName),
JSON.stringify(file, null, 2),
(err) => {
if (err) {
return console.log(err)
}
console.log('Writing to ' + fileName)
}
)