# @marianc/npm-boilerplate

> Basic NPM module boilerplate with eslint and jest

Latest version **0.0.3** (published 2019-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @marianc/npm-boilerplate
pnpm add @marianc/npm-boilerplate
yarn add @marianc/npm-boilerplate
bun add @marianc/npm-boilerplate
```

Provides the command `isweekend`.

## 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.3 |
| Published | 2019-10-02 |
| First published | 2019-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marian Craciun |
| Maintainers | mariancraciun1983 |
| Keywords | boilerplate, npm, module, javascript |

## Links

- npm: https://www.npmjs.com/package/@marianc/npm-boilerplate
- Repository: https://github.com/mariancraciun1983/npm-boilerplate
- Homepage: https://github.com/mariancraciun1983/npm-boilerplate#readme
- npm.io page: https://npm.io/package/@marianc/npm-boilerplate

## Dependencies (2)

- [colors](https://npm.io/package/colors.md) ^1.4.0
- [argparse](https://npm.io/package/argparse.md) ^1.0.10

## Recent versions

- 0.0.3 (latest) — 2019-10-02
- 0.0.2 — 2019-10-02

## README

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

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