0.1.7 • Published 6 years ago

boilerplate-javascript-library v0.1.7

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

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

0.1.7

6 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.1

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.0

7 years ago