Coder Social home page Coder Social logo

markoa-es6's Introduction

Universal Starter Kit to build any javascript ES6 project/library runnable in nodejs and on any browser

Build Status

Dependency Status NPM version NPM downloads

MIT License

Sauce Test Status

Introduction

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.

Philosophy

Just use what you really need

This project doesn't rely on any build system tool like gulp, grunt, duo... By using the make 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

javascript ES6

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!

Tools available

Usage

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

Available tasks

Build and test

$ ./make # or also `$ npm run default`

Convert the ES6 code into valid ES5 combining all the modules into one single file

$ ./make build # or also `$ npm run build`

Run all the tests

$ ./make test # or also `$ npm run test`

Start a nodejs static server

$ ./make serve # or also `$ npm run serve`

To compile and/or test the project anytime a file gets changed

$ ./make watch # or also `$ npm run watch`

Run the saucelabs tests

$ ./make saucelabs # or also `$ npm run saucelabs`

Dependencies

All the code generated depends on the tiny babel/external-helpers You can include the babel helpers directly in your library ( updating this line ) or just loading it in your page before your script:

<script src="your-path-to/babel/external-helpers.js"></script>
<script src="my-awesome-script.js"></script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.