@onextech/react-semantic-booster
Version:
Extended components for react-semantic-ui
177 lines (107 loc) • 6.21 kB
Markdown
# nod
[](https://npmjs.org/package/ggenerator-nod)
[](https://travis-ci.org/diegohaz/nod) [](https://codecov.io/gh/diegohaz/nod/branch/master)
NodeJS module generator/boilerplate.
<p align="center"><img src="https://cloud.githubusercontent.com/assets/3068563/21958520/77e4f45e-da97-11e6-9685-fe380a9cce3d.gif"></p>
## Features
- [**Babel**](https://babeljs.io/) - Write next generation JavaScript today;
- [**Jest**](https://facebook.github.io/jest) - JavaScript testing framework used by Facebook;
- [**ESLint**](http://eslint.org/) - Make sure you are writing a quality code;
- [**Flow**](https://flowtype.org/) - A static type checker for JavaScript used heavily within Facebook;
- [**Travis CI**](https://travis-ci.org) - Automate tests and linting for every push or pull request;
- [**Documentation**](http://documentation.js.org/) - A documentation system so good, you'll actually write documentation.
## Install
The easiest way to use **nod** is through the Yeoman Generator.
```sh
$ npm install -g yo generator-nod
$ yo nod
```
If you don't want to use the generator, you can also download or `git clone` this repo
```sh
$ git clone https://github.com/diegohaz/nod my-module
$ cd my-module
$ rm -rf .git
$ npm install # or yarn
```
Just make sure to edit `package.json`, `README.md` and `LICENSE` files accordingly with your module's info.
## Commands
```sh
$ npm test # run tests with Jest
$ npm run coverage # run tests with coverage and open it on browser
$ npm run lint # lint code
$ npm run docs # generate docs
$ npm run build # generate docs and transpile code
$ npm run watch # watch code changes and run scripts automatically
$ npm run patch # bump patch version and publish to npm e.g. 0.0.1
$ npm run minor # bump minor version and publish to npm e.g. 0.1.0
$ npm run major # bump major version and publish to npm e.g. 1.0.0
```
## Built with Nod
_You can use those modules as a reference when creating yours. If you have built something with Nod, send a PR (try to write a helpful description for Nod users)._
- [**styled-tools**](https://github.com/diegohaz/styled-tools) - Module using `flow-typed`, targeted to browser.
- [**styled-theme**](https://github.com/diegohaz/styled-theme) - Module with `gh-pages`, targeted to browser.
- [**webpack-blocks-happypack**](https://github.com/diegohaz/webpack-blocks-happypack) - Uses Jest snapshots.
- [**webpack-blocks-split-vendor**](https://github.com/diegohaz/webpack-blocks-split-vendor) - Has peer dependencies.
[More examples](https://github.com/search?l=Markdown&q=generator-nod-2196F3&type=Code)
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
### AngularSvg
Create an angular block
### getCrumbSlug
Set custom routes on certain params
**Parameters**
- `crumb` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `index` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- `rules` **{}** set of keys (match.params path) and values (route to go to)
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
### getEmSizeScale
Calculate scale based on y = ax2 + bx + c
**Parameters**
- `size` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The x value
Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The y value
### autoPlay
### sayHello
This function says hello.
**Parameters**
- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Some name to say hello for.
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The hello.
### getCustomClassName
Render the class names based on the custom props selected
**Parameters**
- `customProps` **{prop: className}** a reference list of custom props and classnames
- `allProps` **{className: {string}}** the user-defined props
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the className string to render onto the DOM
### subtractObject
Subtract object from another object (non-recursive)
**Parameters**
- `subtrahend` The part being taken away
- `minuend` The part you start with
Returns **{}** The part that is left after subtraction
### setStyledSpacer
A styled component function to set padding top/bottom of an element
from a mulitplier
**Parameters**
- `spacer`
- `baseEm` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The base em size to scale the spacer (optional, default `5`)
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the css to apply
### setCustomProps
Set custom props
**Parameters**
- `props` **{}**
- `customProps` **{}**
- `defaultProps` **{}**
Returns **{className: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)}**
### mergeClassNames
Merge prev class names with new class names to prevent
overwrite of className prop
**Parameters**
- `newClassName` **(\[] | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))**
- `prevClassName` **(\[] | null)**
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
### mediaCssFactory
Iterate through the mediaCssBreakpoints and create a media template
**Parameters**
- `type` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
Returns **{}**
## License
MIT © [Diego Haz](https://github.com/diegohaz)