You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a template for creating a npm module written in TypeScript.
4
-
5
-
## Usage
6
-
7
-
Just click the "Use this template" button and create a new repository.
8
-
9
-
## Initialization
10
-
11
-
1. Change these lines in `package.json`:
12
-
```json
13
-
{
14
-
"keywords": ["your", "keywords", "<"],
15
-
"description": "Your module description here <",
16
-
"license": "Your license here <",
17
-
```
18
-
2. Change the `README.md` file to your needs.
19
-
3. Add LICENSE file if you want to.
20
-
21
-
## `engines` field in `package.json`
22
-
23
-
### `node`
24
-
25
-
You can specify a node version in this field. We'll use this version to set up the CI environment.
26
-
27
-
### `npm` / `yarn` / `pnpm`
28
-
29
-
You can specify a package manager in this field. We'll use this package manager to install dependencies.
30
-
31
-
## Project Structure
32
-
33
-
Just like a normal TypeScript project, but with a `src` folder.
34
-
We use [mocha](https://mochajs.org/) for testing, all test files should be ended with `.spec.ts`.
35
-
36
-
```
37
-
src/
38
-
index.ts
39
-
your-module.ts
40
-
your-module.spec.ts
41
-
```
42
-
43
-
## Publishing to npm
44
-
45
-
Generate a new npm token and add it to the repository secrets as `NPM_TOKEN`. Then, create a new release and the CI will automatically publish the package to npm.
0 commit comments