Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/a7mooz/ts-gen

Typescript/JavaScript project generator
https://github.com/a7mooz/ts-gen

cli generator javascript package typescript

Last synced: about 2 months ago
JSON representation

Typescript/JavaScript project generator

Awesome Lists containing this project

README

        

TS-GEN



NPM version
NPM downloads
Build status

# CLI

```bash
$ npx @a7mooz/ts-gen@latest
// Or
$ pnpm dlx @a7mooz/ts-gen
// Or (only yarn v3 and above)
$ yarn dlx @a7mooz/ts-gen
```

# API

## Installation

```bash
$ npm install @a7mooz/ts-gen
// Or
$ pnpm add @a7mooz/ts-gen
// Or
$ yarn add @a7mooz/ts-gen
```

## Usage

### ESM

```js
import { create } from '@a7mooz/ts-gen';

create('project/path', {
type: 'library',
lang: 'ts',
name: 'name',
lint: true,
hooks: true,
commitLint: true,
});
```

### CJS

```js
const { create } = require('@a7mooz/ts-gen');

create('project/path', {
type: 'library',
lang: 'ts',
name: 'name',
lint: true,
hooks: true,
commitLint: true,
});
```

### Options

- name?: string

The project's name (defaults to the dir's basename)

- type: string

The project's type (must be one of the available templates in `template/templates`)

- lang: 'ts' | 'js'

The project's language

- lint?: boolean

Whether to add linting (default `true`)

- hooks?: boolean

Whether to add husky git hooks (default `true`)

- commitLint?: boolean

Whether to add commit linting (only works with git hooks) (defaults to `hooks` option)

- moduleType?: 'module' | 'commonjs'

The module type (default `module` if a program and `commonjs` if a library)