GithubHelp home page GithubHelp logo

jsboilerplate's Introduction

jsboilerplate

javascript starter pack

Download the zip file or git clone this repository.

To run your app on the latest stable version of node (with es2015) use NVM to manage your node version.

nvm install stable

Take note of the output with your node & npm version. We will be adding it to your package.json after the next step.

To initialize your project, run

npm init

Fill out the information for your package.json. Add the following between license & dependencies. Replace the node & npm version numbers with the numbers from the output after your nvm install stable.

"engines": {
  "node": "5.10.1",
  "npm": "3.8.3"
},

Install your dependencies

Because gulp, mocha & eslint have CLI tools, if you have not installed them on your machine in the past but want to use them globally, you should add -g to your npm install command in order to utilize them through your machine. You will only have to do this once and on future projects you can simply npm install. Keep in mind however that your global install might conflict with configurations unless you check to update your versions of these packages regularly.

npm install gulp mocha --save
npm install hapi inert chai gulp-concat gulp-sass normalize.css --save
npm install browserify babelify babel-preset-es2015 babel-preset-react --save
npm install babel-plugin-transform-class-properties babel-plugin-transform-decorators-legacy babel-plugin-transform-object-rest-spread --save
npm install babel-register redux-logger --save-dev
npm install watchify chokidar-cli npm-run-all --save-dev
npm install eslint babel-eslint eslint-plugin-babel eslint-plugin-react --save-dev
npm install react react-dom react-redux redux radium --save

Add the following scripts to your package.json's npm scripts.

"build": "npm run build:assets && npm run build:client",
"build:assets": "gulp",
"build:client": "mkdir -p './ui/' && browserify --transform babelify --entry './client/index.jsx' --outfile './ui/index.js'",
"lint": "eslint './client/'",
"test": "mocha --compilers js:babel-register './client/**/test.js'",
"start": "node server/index.js",
"watch": "npm-run-all --parallel watch:build watch:lint watch:test start",
"watch:build": "mkdir -p './ui/' && npm-run-all --parallel watch:build:client watch:build:assets",
"watch:build:client": "watchify --transform babelify --entry './client/index.jsx' --outfile './ui/index.js'",
"watch:build:assets": "gulp watch",
"watch:lint": "chokidar './client/' --initial --command 'npm run lint --silent'",
"watch:test": "chokidar './client/' --initial --command 'npm run test --silent'"

Rename the following files:

babelrc --> .babelrc eslintrc --> .eslintrc gitignore --> .gitignore

Learn more about dotfiles here.


README

Leave this information in your README.

Getting Started

Run npm install

Run Development

Run npm run watch. Open localhost:8000 in your browser.

Run Production

Run npm start. Open localhost:8000 in your browser.

jsboilerplate's People

Contributors

patriciarealini avatar

Watchers

 avatar

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.