0.0.3 • Published 5 years ago

@marianc/npm-boilerplate v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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 or np

Using the module

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

yarn add @marianc/npm-boilerplate
const { isWeekend } = require('@marianc/npm-boilerplate');
console.log(isWeekend(new Date()));

Or just use this Runkit

Or as a cli :

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

Or as a script for your browser

<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

0.0.3

5 years ago

0.0.2

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.1

5 years ago