npm package: @marianc/npm-boilerplate
Description: Basic NPM module boilerplate with eslint and jest
Author: Marian Craciun
Latest version: 0.0.3

<h1 align="center">NPM Module BoilerPlate</h1>

<div align="center">
  <a href="https://travis-ci.org/mariancraciun1983/npm-boilerplate">
    <img src="https://secure.travis-ci.org/mariancraciun1983/npm-boilerplate.svg?branch=master" alt="Travis CI" />
  </a>
  <a href="https://coveralls.io/r/mariancraciun1983/npm-boilerplate">
    <img src="https://img.shields.io/coveralls/mariancraciun1983/npm-boilerplate?branch=master&style=flat" alt="Coverage Status" />
  </a>
  <a href="https://david-dm.org/mariancraciun1983/npm-boilerplate">
    <img src="https://david-dm.org/mariancraciun1983/npm-boilerplate/status.svg" alt="Dependencies Status" />
  </a>
  <a href="https://www.npmjs.com/package/@marianc/npm-boilerplate">
    <img src="https://img.shields.io/npm/v/@marianc/npm-boilerplate?style=flat" alt="NPM version" />
  </a>
  <a href="https://david-dm.org/mariancraciun1983/npm-boilerplate">
    <img src="https://david-dm.org/mariancraciun1983/npm-boilerplate/status.svg"  alt="Dependencies Status" />
  </a>
  <a href="https://david-dm.org/mariancraciun1983/npm-boilerplate">
    <img src="https://david-dm.org/mariancraciun1983/npm-boilerplate/dev-status.svg"  alt="devDependencies Status" />
  </a>
   <a href="https://www.codefactor.io/repository/github/mariancraciun1983/npm-boilerplate">
    <img src="https://www.codefactor.io/repository/github/mariancraciun1983/npm-boilerplate/badge" alt="code quality">
  </a>
  <a href="https://deepscan.io/dashboard#view=project&tid=5557&pid=7400&bid=74077">
    <img src="https://deepscan.io/api/teams/5557/projects/7400/branches/74077/badge/grade.svg" alt="DeepScan grade">
  </a>
  <a href="https://bundlephobia.com/result?p=@marianc/npm-boilerplate">
    <img src="https://badgen.net/bundlephobia/min/@marianc/npm-boilerplate" alt="minified size">
  </a>
  <a href="https://opensource.org/licenses/MIT">
    <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License" />
  </a>
</div>

<br />

## About the code

This code can be used as a starting point for a new nodejs module. It has various tools configured for transpiling, testing, linting, building and deployment. You could clone it, remove the .git folder, change all the _npm-boilerplate_ references and commit it to your own repo.

# Commands
- `yarn run clean` - Removes `dist/` directory
- `yarn run examples` - Runs the examples
- `yarn run examples:watch` - Runs examples in watch mode
- `yarn run test` - Tests in jest with coverage
- `yarn run test:watch` - Run tests in watch mode with coverage
- `yarn run lint` - Linter based on eslint
- `yarn run build` - Alias of build:node + build:web
- `yarn run build:node` - Babel transpiler (ES6 => ES5 + minify).
- `yarn run build:web` - Builder for web/browsers
- `yarn run prepare` - Hook for npm. Do all the checks before publishing your module.
- `yarn run deploy` - Uses the np module to deploy the npm module (tags, releases, versioning)

# NPM Publishing
In order to publish this package to NPM you will need to have an account and package.json updated to your preferences. This repo also comes with _pm_ which makes the process a bit better.
Check out more on [creating-and-publishing-scoped-public-packages](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages) or [np](https://www.npmjs.com/package/np)

# Using the module
In order to use this as a **nodejs module** you will need to include it as a regular package:

```bash
yarn add @marianc/npm-boilerplate
```

```js
const { isWeekend } = require('@marianc/npm-boilerplate');
console.log(isWeekend(new Date()));
```
Or just use [this Runkit](https://runkit.com/mariancraciun1983/npm-boilerplate-tester)


Or as a **cli** :

```bash
npm install -g @marianc/npm-boilerplate
isweekend
# Today is weekday
```

Or as a script for your **browser**

```html
<script src="https://unpkg.com/@marianc/npm-boilerplate@0.0.1/dist/index.web.js"></script>
<script>
    try {
      var weekend = isWeekend(new Date());
      console.log(`Today is ${weekend ? 'Weekend': 'Weekday' }`)
    } catch (ex) {
        console.log(ex);
    }
</script>
```
Or check [this Playcode](https://playcode.io/458833)