open-index/open-npm huggingface dataset:
npm package: @starters/cli
Description: Get your next project started
Author: Jake Hamilton
Latest version: 2.3.0

# @starters/cli

🚀 Get your next project off the ground quickly
with [@starters/cli](https://github.com/jakehamilton/starters)!

## Install

```shell
npm install -g @starters/cli
```

## Usage

```shell
starters create <where> --template <template>
```

The `<where>` argument specifies where to create the project.

The `<template>` argument is either:

-   An NPM package name (eg. `@starters/typescript`)
-   A Git repository (eg. `git@github.com:jakehamilton/starter-typescript-template`)

## Creating A Template

### Git Templates

A Git template is simply a repository that will be cloned onto the user's machine. For initial configuration, you may add a JavaScript file at `.starter/index.js` in your repository. This file will be called once the template has been downloaded.

#### Example

##### .starter/index.js

> NOTE: This file should export a function that returns a promise.

```typescript
const path = require("path");

module.exports = function ({ inquirer, render, where }) {
    return inquirer
        .prompt([
            {
                type: "input",
                name: "name",
                message: "Module Name",
            },
        ])
        .then(function (answers) {
            const package = path.resolve(where, "package.json");

            return render(package, answers);
        });
};
```

##### package.json

```json
{
    "name": "<%= name %>"
    ...
}
```

#### Types

The exported function receives an options argument with the following type signature:

```typescript
interface options {
    inquirer: Inquirer;
    render: RenderInPlace;
    fs: FS;
    rimraf: Rimraf;
    where: string;
}
```

`inquirer` is from the [inquirer](https://www.npmjs.com/package/inquirer) module.  
`render` is from the [render-in-place](https://www.npmjs.com/package/render-in-place) module.  
`fs` is from the [fs-extra](https://www.npmjs.com/package/fs-extra) module.  
`rimraf` is from the [rimraf](https://www.npmjs.com/package/rimraf) module.

## NPM templates

An NPM template exists as an NPM module which has full control over how to create and install its template. To create an NPM template, all you need to do is publish an NPM module that exports a single function. When a user installs your template, your module will be installed and its function invoked.

#### Example

```typescript
import * as fs from "fs";
import * as path from "path";

export default async ({ where }) => {
    fs.writeFileSync(path.resolve(where, "README.md"), "# Hello World!");
};
```

#### Types

The exported function receives an options argument with the following type signature:

```typescript
interface options {
    inquirer: Inquirer;
    render: RenderInPlace;
    fs: FS;
    rimraf: Rimraf;
    where: string;
}
```
npm package: @starters/core
Description: The core logic for managing templates.
Author: Jake Hamilton
Latest version: 1.8.0

# @starters/core

This module contains the internals for handling starter templates.

## Install

```shell
npm install --save @starters/core
```

## Usage

```js
const starters = require("@starters/core");

await starters.create(
    "/path/to/project",
    "my-template-name",
    "my-package-name",
    "/my/cache"
);
```

### `starters.create(where, template [, name [, cache]])`

This function creates a new project from a template. The `where` parameter is a path
to the location that the project should be created at. The `template` parameter is either
the name of an NPM package _or_ the address of a Git repository.

Here are some examples for the `template` parameter:

```
my-npm-package
@my-scope/my-npm-package

git@github.com:my-user/my-project
```

The `name` parameter specifies a package name that is passed to the template. The `cache`
parameter is used to specify a directory to install NPM template packages to. Both of these
parameters are optional.
npm package: @starters/empty
Description: Start your next JavaScript project!
Author: Jake Hamilton
Latest version: 1.2.0

# @starters/empty

🚀 Get your next project off the ground quickly
with [@starters/cli](https://github.com/jakehamilton/starters)!

## Usage:

Install [@starters/cli](https://github.com/jakehamilton/starters) globally (optional):

```shell
npm i -g @starters/cli
```

Install this template:

```shell
# If installed globally
starter create my-project --template @starters/empty

# If not installed globally
npx @starters/cli create my-project --template @starters/empty
```