# @ozum/create-tsm

> Highly opinionated and customizable boilerplate for creating and updating TypeScript modules.

Latest version **1.3.0** (published 2025-11-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ozum/create-tsm
pnpm add @ozum/create-tsm
yarn add @ozum/create-tsm
bun add @ozum/create-tsm
```

Provides the command `tsm`.

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2025-11-03 |
| First published | 2023-07-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 8 |
| Unpacked size | 77.3 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Özüm Eldoğan |
| Maintainers | ozum |
| Keywords | boilerplate, TypeScript, config, initializer, updater, development workflow |

## Links

- npm: https://www.npmjs.com/package/@ozum/create-tsm
- Repository: https://github.com/ozum/create-tsm
- Homepage: https://github.com/ozum/create-tsm#readme
- Issues: https://github.com/ozum/create-tsm/issues
- npm.io page: https://npm.io/package/@ozum/create-tsm

## Dependencies (8)

- [inquirer](https://npm.io/package/inquirer.md) ^9.2.22
- [user-meta](https://npm.io/package/user-meta.md) ^1.0.0
- [simple-git](https://npm.io/package/simple-git.md) ^3.24.0
- [fast-equals](https://npm.io/package/fast-equals.md) ^5.0.1
- [@octokit/rest](https://npm.io/package/@octokit/rest.md) ^20.1.1
- [read-git-user](https://npm.io/package/read-git-user.md) ^2.1.0
- [inquirer-npm-name](https://npm.io/package/inquirer-npm-name.md) ^4.0.0
- [libsodium-wrappers](https://npm.io/package/libsodium-wrappers.md) ^0.7.13

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2025-11-03
- 1.2.14 — 2024-05-30
- 1.2.13 — 2024-05-07
- 1.2.12 — 2024-04-02
- 1.2.11 — 2024-04-02
- 1.2.10 — 2024-03-21
- 1.2.9 — 2024-01-30
- 1.2.8 — 2023-12-23
- 1.2.7 — 2023-11-30
- 1.2.6 — 2023-11-30
- 1.2.5 — 2023-11-29
- 1.2.4 — 2023-08-31
- 1.2.3 — 2023-08-31
- 1.2.2 — 2023-08-12
- 1.2.1 — 2023-08-12
- … 7 more at https://npm.io/package/@ozum/create-tsm/versions

## README

# Description

Highly opinionated and customizable boilerplate for creating and **updating** TypeScript modules.

No need to install anything. Just use your package manager.

Creates your project and provides automatic verification, push, and release scripts.

# Usage

## Create

```sh
$ mkdir my-project
$ NPM_TOKEN=xyz123 GITHUB_TOKEN=xyz123 npm init @ozum/tsm@latest
```

It will ask your package manager. You can select **`npm`, `pnpm`, or `yarn`** even if you started the script with `npm init`.

## Update (Experimental)

```sh
$ npx @ozum/create-tsm@latest
```

- Updates `package.json` dependencies and base scripts starting with `base:`.
- Updates files in `.husky` and `config/tsm`.
- Adds new configs to the root if any are available.
- Does **NOT** change/update configs in the root directory.
- Does **NOT** change/update GitHub workflows.

# Features

- Supports **`npm`, `pnpm` and `yarn`**.
- Creates `package.json` with necessary `devDependencies` and development-related `scripts`.
- Allows you to use up-to-date [shared GitHub workflow](https://github.com/ozum/create-tsm/blob/main/.github/workflows/base-build-and-test.yml) or the workflow at the time of initialization. (Based on the answer to the `use shared GitHub workflow` question)
- Updates existing `package.json`, base configurations, and base scripts. Does not touch derived scripts and configurations.
  - Writes `package.json` if only it is changed.
  - Executes `install` if only dependencies have changed.
- Creates `package.json` scripts prefixed with `base:`, so you can customize yours without risking future updates.
- Where possible, creates base scripts in the `config/tsm` directory, so you can customize yours without risking future updates.
- Provides [reusable GitHub workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows).
- **(Optional)** Creates a GitHub repository.
- **(Optional)** Adds `NPM_TOKEN` secret to the created repository.
- Never stores the security tokens.
- Creates a GitHub workflow for CI/CD which utilizes [`Semantic Release`](https://semantic-release.gitbook.io/semantic-release/)
- Let's GitHub Workflow verify (test, lint, build, audit) and publish the npm package.
- Has stringent ESLint rules but can be customized.
- Configures and supports many tools out of the box. No configs are needed.
  - [ESLint](https://eslint.org/) with three configurations. (`ozum`, `ozum-minimum`, `ozum-maximum`). See [eslint-config-ozum](https://www.npmjs.com/package/eslint-config-ozum)
  - [Prettier](https://prettier.io/)
  - [EditorConfig](https://editorconfig.org/)
  - [Commitizen](http://commitizen.github.io/cz-cli/)
  - [commitlint](https://commitlint.js.org/)
  - [Jest](https://jestjs.io/)
  - [Knip](https://github.com/webpro/knip)
  - [Lint Staged](https://github.com/okonet/lint-staged)
  - [TypeDoc](https://typedoc.org/)
  - [GitHub Actions](https://docs.github.com/en/actions)
  - [Husky](https://typicode.github.io/husky/)
  - [swpm](https://github.com/deinsoftware/swpm)
  - [semantic-release](https://semantic-release.gitbook.io/semantic-release)
- Generates LICENSE file.

## Scripts

Below are the `package.json` scripts generated and their default behavior. Do not change the scripts starting with **`base:`** because this tool will overwrite them during the update.

| name       | EU                       | description                                                                                                                                                                                                                                                                                                                                                                      |
| ---------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| verify     | :smiley:                 | Tests and check lint, audit, format, and dependencies of the project.                                                                                                                                                                                                                                                                                                            |
| release    | :smiley:                 | <ul style="padding-left:15px"><li>Verifies your project</li><li>Commits & pushes the project to the GitHub</li><li>Ensures your commit message is [conventional](https://www.conventionalcommits.org/)</li><li>Lets GitHub CI/CD release your package to the NPM with correct version number using [semantic-release](https://semantic-release.gitbook.io/semantic-release)</li> |
| test       | :smiley:                 | Tests the project.                                                                                                                                                                                                                                                                                                                                                               |
| dev        | :question:               | Starts build process in `watch` mode.                                                                                                                                                                                                                                                                                                                                            |
| lint       | :question:               | Lints and fixes errors when possible.                                                                                                                                                                                                                                                                                                                                            |
| format     | :question:               | Formats the files.                                                                                                                                                                                                                                                                                                                                                               |
| build      | :question:               | Builds your project.                                                                                                                                                                                                                                                                                                                                                             |
| docs:api   | :question:               | Builds API docs with [TypeDoc](https://typedoc.org/).                                                                                                                                                                                                                                                                                                                            |
| commit     | :heavy_exclamation_mark: | Executes `git commit` with [Commitizen](http://commitizen.github.io/cz-cli/), but you don't need to use it, because [Husky](https://typicode.github.io/husky/) catches `git commit`.                                                                                                                                                                                             |
| commitlint | :heavy_exclamation_mark: | Executes tasks for [commitlint](https://commitlint.js.org/).                                                                                                                                                                                                                                                                                                                     |
| precommit  | :heavy_exclamation_mark: | Executes [Lint Staged](https://github.com/okonet/lint-staged) tasks and verifications.                                                                                                                                                                                                                                                                                           |
| prepare    | :heavy_exclamation_mark: | Ensures [Husky](https://typicode.github.io/husky/) is installed.                                                                                                                                                                                                                                                                                                                 |

<br/>

| Legend                   | Purpose        | Description                                                                       |
| ------------------------ | -------------- | --------------------------------------------------------------------------------- |
| :smiley:                 | For end user   | Should be used by the end user in a normal workflow.                              |
| :question:               | Occasional use | Used by end user occasionally when needed.                                        |
| :heavy_exclamation_mark: | Special need   | Normally not used by end user. Only needed for customization or special purposes. |

## What about Monorepo?

[TurboRepo](https://turbo.build/repo) is an excellent monorepo tool and easy to learn and start.

I suggest deleting the created GitHub Action file because `Semantic Release` does not support monorepos.

I examined several tools but couldn't find an **easy** way to publish multiple packages using `Semantic Release` with mono repos.

I'm open to suggestions for monorepo support if the solution is

- Easy to setup for end users
- Easy to maintain for end users
- Unobtrusive
- Robust
- Widely supported

# (Optional) GitHub Access Token Permissions

Optionally, this boilerplate can create a GitHub repository and add the `NPM_TOKEN` secret. I advise creating fine-grained personal access tokens for increased security to limit actions. You can create fine-grained access tokens [here](https://github.com/settings/personal-access-tokens/new).

- Administration: Read and write (To create a GitHub repository)
- Metadata: Read-only (Mandated by GitHub)
- Secrets: Read and write (This is **OPTIONAL** and used to add `NPM_TOKEN`)

# FAQ

**Q:** How to customize `package.json` scripts?<br/>
**A:** There are `base` and `normal` scripts. Add your custom tasks to the normal scripts without changing the `base:` scripts. For example: `{ "verify": "my-task && swpm run base:verify" }`

**Q:** How to change or remove coverage thresholds of the tests?<br/>
**A:** Add `jest.config.js` the following: ` coverageThreshold: { global: { branches: 0, functions: 0, lines: 0, statements: 0 } }`

**Q:** How to turn off tests?<br/>
**A:** Change `test` script in `package.json` as similar to `{ "test": "echo No tests are available. Skipping testing step." }`

---
_Source: https://npm.io/package/@ozum/create-tsm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
