# jsnip

> Get common JavaScript code snippets

Latest version **0.0.10** (published 2017-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsnip
pnpm add jsnip
yarn add jsnip
bun add jsnip
```

## 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.0.10 |
| Published | 2017-03-20 |
| First published | 2017-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Wuergler |
| Maintainers | radiovisual |
| Keywords | get, fetch, JS, js, code, snip, snippets, from, node, samples, strings, templates |

## Links

- npm: https://www.npmjs.com/package/jsnip
- Repository: https://github.com/radiovisual/jsnip
- Homepage: https://github.com/radiovisual/jsnip#readme
- Issues: https://github.com/radiovisual/jsnip/issues
- npm.io page: https://npm.io/package/jsnip

## Dependencies (1)

- [handlebars](https://npm.io/package/handlebars.md) ^4.0.6

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.10 (latest) — 2017-03-20
- 0.0.9 — 2017-03-20
- 0.0.8 — 2017-03-19
- 0.0.7 — 2017-03-18
- 0.0.6 — 2017-03-18
- 0.0.5 — 2017-03-17
- 0.0.4 — 2017-03-16
- 0.0.3 — 2017-03-16
- 0.0.2 — 2017-03-16
- 0.0.1 — 2017-03-16

## README

# jsnip [![Build Status](https://travis-ci.org/radiovisual/jsnip.svg?branch=master)](https://travis-ci.org/radiovisual/jsnip)

> Get common JavaScript code snippets.

:hamburger: This is my WIP snippet library where you can get customizable JS
code snippets from within your node applications.

**Note:** The React snippets are currently in a React Native flavor and the
JavaScript is intended to reflect the ES2015 (ES6) syntax.

If you want to get snippets from the command line, check out [jsnip-cli](https://github.com/radiovisual/jsnip-cli).

## Install

```
$ npm install --save jsnip
```


## Usage

```js
const jsnip = require('jsnip');
jsnip('reducer', { name: 'MyAwesomeClass' });
```

## API

### jsnip(input, [options])

#### input

Type: `string`

The name of the code snippet you want to print. Click the link to see the actual
snippet file.

| input | Description |
| ------| -----------|
| [function](snippets/react-function.js)   | A functional React component. |
| [class](snippets/react-class.js)         | A class-based React component. |
| [action](snippets/redux-actions.js)      | A Redux action snippet. |
| [reducer](snippets/redux-reducer.js)     | A Redux reducer snippet. |
| [lorem](snippets/lorem.txt)              | 3 paragraphs of lorem ipsum text. |
| [reduxclass](snippets/redux-class.js)              | A connected (Redux) React class-based component. |

#### options

Type: `object`  

Possible options are:

|  | Type | Default | Description |
| ----- | ----- | ----- | ----- |
| `name`      | `string` | `'ClassName'` | Specify the function or class name to use in the output |


## Contribution

Currently this module is for my own productivity, so I won't be accepting Pull
Requests that try to impose specific styles or opinions. However I will accept Pull
Requests that aim to populate the snippet library with useful goodies. :hamburger:

## Related

- [jsnip-cli](https://github.com/radiovisual/jsnip-cli) Get these snippets from the command line; Optionally copy to the clipboard.

## License

MIT © [Michael Wuergler](http://numetriclabs.com)

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