# mk-index

> Generate index.ts or index.js when building npm package.

Latest version **1.2.3** (published 2024-02-15) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install mk-index
pnpm add mk-index
yarn add mk-index
bun add mk-index
```

Provides the commands `mk-index`, `gen-index`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2024-02-15 |
| First published | 2024-02-15 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Beeno Tung |
| Maintainers | beenotung |
| Keywords | gen-index, generate, code-generation, index, library, cli, util, generator, npm, index.js, index.ts |

## Links

- npm: https://www.npmjs.com/package/mk-index
- Repository: https://github.com/beenotung/mk-index
- Homepage: https://github.com/beenotung/mk-index#readme
- Issues: https://github.com/beenotung/mk-index/issues
- npm.io page: https://npm.io/package/mk-index

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.2.3 (latest) — 2024-02-15
- 1.2.2 — 2024-02-15

## README

# mk-index

[![npm Package Version](https://img.shields.io/npm/v/mk-index.svg?maxAge=2592000)](https://www.npmjs.com/package/mk-index)

Generate index.ts or index.js when building npm package.

## Package Info

package name on npm: `mk-index`

available cli: `gen-index` (alias), `mk-index`

### Package History

This package is renamed from `@beenotung/gen-index` to `mk-index` to keep the package name concise.

## Usage

```bash
mk-index [OPTION]... [DIRECTORY]
```

DIRECTORY is set to be `src` by default.

### Optional Options

Below message will be shown when the cli is run with `--help` option

```
--ext ts|js
               Set the file extension.
               Should be either ts or js.
               Default to be ts

--excludeDir dir_1,dir_2,...dir_n
               List of directories to skip, e.g. "internal"

--single-quote
               Generate import statement with single quote in string value.
               (Default option)
--double-quote
               Generate import statement with double quote in string value.

--semi
               Generate import statement with tailing semi colon.
               (Default option)

--no-semi
               Generate import statement without tailing semi colon.
```

### Example package.json

```json
{
  "main": "dist/index.js",
  "scripts": {
    "prebuild": "mk-index --excludeDir internal",
    "build": "tsc --outDir dist src/*.ts"
  },
  "dependencies": {
    "mk-index": "^1.2.2"
  }
}
```

## License

This project is licensed with [BSD-2-Clause](./LICENSE)

This is free, libre, and open-source software. It comes down to four essential freedoms [[ref]](https://seirdy.one/2021/01/27/whatsapp-and-the-domestication-of-users.html#fnref:2):

- The freedom to run the program as you wish, for any purpose
- The freedom to study how the program works, and change it so it does your computing as you wish
- The freedom to redistribute copies so you can help others
- The freedom to distribute copies of your modified versions to others

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