
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
package-json-from-template
Advanced tools
Generate a package.json file from a template
Sometimes you create a repository that generates a packaged version of your
project and you want that to have it own package.json file but the same
name and version inherited from your original project.
If you want to install package-json-from-template globally, use the follow command from your terminal:
$ npm install -g package-json-from-template
Otherwise just add PackageJsonFromTemplate to your project with:
$ npm install --save-dev package-json-from-template
If you prefer using Yarn:
$ yarn add --dev package-json-from-template
$ Usage: pack-gen [path] [options] -- [diff args]
Options
-t, --template=<filename> The template file to be used for generating the new package.json file. [default: <path>/package.tpl.json]
-s, --source=<filename> The location of your `package.json` file. [default: the root project directory will be used]
[path] The working directory in where generating package.json file
Examples
Generate a new package.json file inside the ./package folder
$ pack-gen package
Generate a new package.json using the base package.json file located under the src directory
$ pack-gen package --source=src/package.json
Generate a new package.json file inside the ./package folder using a my-template.json file as a template
$ pack-gen package --template=my-template.json
Now, assuming that your project generate a distribution version
of your node module inside a dist folder, add a pack-gen script
to generate a package.json file inside that directory to
call after your build task is completed.
"scripts": {
"pack-gen": "pack-gen ./dist",
}
Note that your dist folder will need to contain a
package.tpl.json file to use as a template.
If you wish to use a template file sitting elsewhere, you can use
the template flag and specify a different path like this:
"scripts": {
"pack-gen": "pack-gen ./dist --template=/templates/my-package.teplate.json",
}
git checkout -b my-new-featuregit add .git commit -am 'Add some feature'git push origin my-new-featureMIT License © SonnY
FAQs
Generate a package.json file from a template
The npm package package-json-from-template receives a total of 10 weekly downloads. As such, package-json-from-template popularity was classified as not popular.
We found that package-json-from-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.