jsnip
v0.0.10
Published
Get common JavaScript code snippets
Downloads
13
Maintainers
Readme
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.
Install
$ npm install --save jsnip
Usage
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 | A functional React component. | | class | A class-based React component. | | action | A Redux action snippet. | | reducer | A Redux reducer snippet. | | lorem | 3 paragraphs of lorem ipsum text. | | reduxclass | 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 Get these snippets from the command line; Optionally copy to the clipboard.
License
MIT © Michael Wuergler