# inject-cli

> Simple CLI for sloth-ts-injection

Latest version **0.1.0** (published 2019-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install inject-cli
pnpm add inject-cli
yarn add inject-cli
bun add inject-cli
```

Provides the command `inject`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-02-07 |
| First published | 2019-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 20.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ImOverlord |
| Maintainers | imoverlord |
| Keywords | cli, inject, injector, dependency injection, dependency, injection |

## Links

- npm: https://www.npmjs.com/package/inject-cli
- Repository: https://github.com/ImOverlord/inject-cli
- Homepage: https://github.com/ImOverlord/inject-cli#readme
- Issues: https://github.com/ImOverlord/inject-cli/issues
- npm.io page: https://npm.io/package/inject-cli

## Dependencies (6)

- [commander](https://npm.io/package/commander.md) ^2.19.0
- [typescript](https://npm.io/package/typescript.md) ^3.2.4
- [@types/jest](https://npm.io/package/@types/jest.md) ^23.3.13
- [@types/node](https://npm.io/package/@types/node.md) ^10.12.19
- [app-root-path](https://npm.io/package/app-root-path.md) ^2.1.0
- [sloth-ts-injection](https://npm.io/package/sloth-ts-injection.md) ^1.0.0

## 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

- 0.1.0 (latest) — 2019-02-07
- 0.0.4 — 2019-02-07
- 0.0.3 — 2019-02-07
- 0.0.2 — 2019-02-06
- 0.0.1 — 2019-02-06

## README

# Inject-cli

[![Build Status](https://travis-ci.org/ImOverlord/inject-cli.svg?branch=master)](https://travis-ci.org/ImOverlord/inject-cli)
[![Coverage Status](https://coveralls.io/repos/github/ImOverlord/inject-cli/badge.svg?branch=master)](https://coveralls.io/github/ImOverlord/inject-cli?branch=master)

Simple cli for creating projects that used Dependency injection. The cli uses [sloth-ts-injection](https://github.com/ImOverlord/sloth-ts-injection) as DI library.

# Installing

```
$ npm i -g inject-cli
```

# Getting Started

You can use the cli to create a new project. During the creation on the new project, it will create the package.json, install the DI lib.
```
$ inject init ProjectName
```

You can then start coding in the src/app.ts.

# Create a new Class

Once the project created you can create your first class.
```
$ inject class ClassName
```

The Class will be created in the src/ folder. You can then call it from the src/app.ts

```ts
import { Injector } from 'sloth-ts-injection';

import { ClassName } from './src/ClassName/ClassName';

const inject = new Injector();
const commander: ClassName = inject.inject(ClassName);
```

You can now call its member functions.

# Custom Templates

You can use the cli to create a custom class template. For this, you need to create a folder .injector at the root of your project. Here is the template used by default.

```ts
import { slothInject } from 'sloth-ts-injection';

@slothInject()
export class __NAME__ {

    constructor() { }
}
```

`__NAME__` is reserved as it is replaced by the Class Name.

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