Can I use `npm init <initializer>` with create-<initializer> packages that are not published to the registry?

I recently learned that npm-init now has support for custom initializers by using the format npm init <initializer>.

The docs clearly state that the way npm enables this is by searching for a package named create-<initializer> and then uses npx to run the bin in that package.

My question is… how can I use a custom initializer that is NOT published to a registry?
In my case I’m looking to create an internal initializer for my team but do not want do make it public.

You might be able to publish a private package for this, assuming you have a pricing plan that supports that.

I do not have a plan for private packages :-(
Was looking to leverage our internal repository.

Well, you can always use npx (which, to be clear, is part of npm since at least 2 years). General use case (fill in command, user, repo and --options) for GitHub repositories:

$ npx command@github:user/repo --options

Bitbucket, GitLab and other hosts are also supported.

2 Likes

oh yeah, using npx for this is actually a great idea.

thanks!

2 Likes