https://github.com/chrisrzhou/init-js
A simple config-driven CLI to initialize JS projects.
https://github.com/chrisrzhou/init-js
esm init js node
Last synced: about 1 month ago
JSON representation
A simple config-driven CLI to initialize JS projects.
- Host: GitHub
- URL: https://github.com/chrisrzhou/init-js
- Owner: chrisrzhou
- License: mit
- Created: 2021-03-24T10:04:48.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-01T06:23:54.000Z (about 5 years ago)
- Last Synced: 2025-08-22T12:41:56.001Z (9 months ago)
- Topics: esm, init, js, node
- Language: JavaScript
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# init-js
A simple config-driven CLI to initialize JS projects.
[![Build][build-badge]][build]
---
## Install
You may install globally with NPM from the [Github][] repo but it is *recommended* to [use](#use) directly with `npx` as detailed in the next section.
```sh
npm install -g github:chrisrzhou/init-js
```
## Use
`init-js` is an [ESM][] module requiring Node 12+.
Use with `npx`:
```sh
npx github:chrisrzhou/init-js --github my-github-username --name my-package-name
```
The `--github` and `--name` are required arguments that will be used to initialize various files.
Creates the following files:
- `.github/workflow/main.yml`
- `.editorconfig`
- `.gitignore`
- `license` (MIT)
- `package.json`
- `readme.md`
- `tsconfig.json`
### Config
You can use a custom config file with the `--config` argument.
The base config is personalized for use by the [author][].
```sh
npx init-js --name=my-package-name --github=my-github-username --config=path/to/my-config.json
```
```ts
interface Config {
author: {
firstName: string;
lastName: string;
email: string;
url: string;
github: string;
};
package: NodePackageInterface; // https://nodejs.dev/learn/the-package-json-guide
};
```
[build-badge]: https://github.com/chrisrzhou/init-js/workflows/main/badge.svg
[build]: https://github.com/chrisrzhou/init-js/actions
[author]: https://github.com/chrisrzhou
[esm]: https://nodejs.org/api/esm.html
[github]: https://github.com/chrisrzhou/init-js