Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

boilerplate-javascript-library

techcoop45MIT0.1.7

A boilerplate for a generic javascript library which compiles for use as an ES6 module or UMD (for legacy apps)

techcoop, boilerplate, webpack, babel, library, AMD, UMD

readme

Boilerplate-Javascript-Library

Maintenance Status NPM version Travis build

A boilerplate for a generic javascript library which compiles for use as an ES6 module or UMD (for legacy apps)
Webpack / Babel / Jest / Sass

Requirements

1) node > 6.0.0 2) yarn (or npm latest) > 0.10.0

Installation

yarn install

Usage

ES6

import { getOutput, Module } from 'boilerplate-javascript-library'

// Static function
const staticFunction = getOutput('Hello', 'World')

// Create new instance of class
const instance = new Module()
const classFunction = instance.get('Hello', 'World')

Node

var BoilerplateJavascriptLibrary = require('boilerplate-javascript-library')

// Static function
var staticFunction = BoilerplateJavascriptLibrary.getOutput('Hello', 'World')

// Create new instance of class
var instance = new BoilerplateJavascriptLibrary.Module()
var classFunction = instance.get('Hello', 'World')

UMD

// Imported to global object
var instance, output

// Static function with default param
output = BoilerplateJavascriptLibrary.getOutput('Hello', 'World')

// Static function with parameter
output = BoilerplateJavascriptLibrary.getOutput('Hello', 'World', ', ')

// Class with default constructor parameter
instance = new BoilerplateJavascriptLibrary.Module()
output = instance.get('Hello', 'World')

// Class with constructor parameter
instance = new BoilerplateJavascriptLibrary.Module(', ')
output = instance.get('Hello', 'World')

Development

# Development
yarn start

Testing

# Run test normal
yarn test

# Run watcher
yarn watch

Releasing

# Compile AMD
yarn compile:amd

# Compile UMD
yarn compile:umd

# Compile examples
yarn compile:examples

# Create new versioned release
yarn release

Documentation for release library https://github.com/conventional-changelog/standard-version

Commit message format https://conventionalcommits.org/

Documentation

You can see the legacy UMD module in use in examples/index.html

TODO

  • Improve handling for styles in es6

Contributors

Colin Gagnon

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.1.7 (2018-02-08)

0.1.5 (2017-09-13)

Bug Fixes

0.1.4 (2017-09-11)

Bug Fixes

0.1.2 (2017-09-11)

Bug Fixes

0.1.1 (2017-09-11)

0.1.3 (2017-09-11)

0.1.2 (2017-09-11)

Bug Fixes

  • patches broken release command (#4) (c0bc203)
  • patches docs command, adds description to package (#3) (db5d0df)
  • Patches style handling, move examples to docs, updates readme (#2) (342b22e)

0.1.0 (2017-09-09)

Features

0.0.2 (2017-09-09)

Change Log