Universal Starter Kit to build any javascript ES6 project/library runnable in nodejs and on any browser
javascript 2015/es6/next introduces a lot of new cool features unfortunately not yet available in the current modern browsers. This starter kit contains all the tools you need to let you run your ES6 code on any kind of platform.
Just use what you really need
This project doesn't rely on any build system tool like gulp, grunt, duo... By using the make.js file and customizing the tasks in the tasks folder you should be able to develop any kind of javascript project just fitting it to your needs
import helpers from './helpers/helpers'
/**
* @class
* An awesome script
*/
class Greeter {
constructor(name = 'Dear Coder', text = 'hi there') {
this.name = name
this.text = text
}
get message() {
return `${this.text} ${this.name}!`
}
set message(text) {
this.text = helpers.trim(text)
}
}
export default Greeter
var greeter = new Greeter()
console.log(greeter.message) // -> "hi there Dear Coder!"
// these white spaces will be trimmed
greeter.message = ' goodbye '
console.log(greeter.message) // -> "goodbye Dear Coder!"
Once you've downloaded the files in this repo please run the following command in your terminal from the project folder (it may require sudo
):
$ npm install
Browsing the make.js file you will find all the available terminal commands to compile/test your project. This file contains also the script name used for the output All the build tasks available are based on the native javascript promises so you will be able to chain and combine them as you prefer
If you have installed correctly all the nodejs modules you can start writing your javascript modules into the src
folder of course using the awesome javascript es6 syntax.
$ node make # or also `$ npm run default`
$ node make build # or also `$ npm run build`
$ node make test # or also `$ npm run test`
$ node make serve # or also `$ npm run serve`
$ node make watch # or also `$ npm run watch`
List of projects build with es6-project-starter-kit
: