npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

merge-template

v1.0.12

Published

Merge dependencies from template.

Downloads

5

Readme

merge-template

Merge your project with predefined templates or customs, install dependencies and apply some codemods.

Installation

npm install merge-template -g

Usage

To use default default template and files run in your project root:

merge-template

With default template

It will:

You can skip this step with option --no-install:

merge-template --no-install

NOTE: files and directories from the template directory will override existing files.

You can skip this step with the option --no-copy-files or use your own template (see section Customization).

merge-template --no-copy-files
  • modify package.json in your project by rules specified in package-json-overrides.json.

Customization

Command line options


--template                    use template directory with package-json-overrides.json (required) and files to copy
--no-install                  skip installation step
--no-copy-files               don't copy files from template directory
--no-delete                   don't delete dependencies listed in "deleteDependencies" in package-json-overrides.json
--no-post-tasks               don't execute post tasks (section "postTasks" in package-json-overrides.json)
--ignore-files                files in template directory that should't be copied into project. Default: 'node_modules' 'build' 'dist' '.git' 'package-json-overrides.json'

You can specify your own template directory with option --template. It must include a file package-json-overrides.json.

merge-template --template /home/user/my-custom-template-directory/

Any other directories and files in this directory will be copied into your project root, overriding existing ones.

package-json-overrides.json

This file should be JSON and can contain the following sections:

  1. dependencies

    The format is the as in package.json dependencies, it will be installed or updated to specified version.

  2. devDependencies

    The format is the as in package.json devDependencies, it will be installed or updated to specified version.

  3. deleteDependencies

    Dependencies to remove. The format is the as in package.json dependencies, but versions will be ignored.

  4. mergeSections

    The value of this section will be merged into existing package.json.

  5. addSections

    The value will be added to the existing package.json, overriding existing sections.

  6. postTasks

    Shell commands to execute after other steps. Nested lists where each element is an array of form [command, …args], e.g.:

"postTasks": [["npx", "@mui/codemod", "v5.0.0/preset-safe", "src"]]