Giter VIP home page Giter VIP logo

es6_node_basics's Introduction

ES6 Basics

This repository is an introduction to ES6, as well as using Babel on a simple NodeJS site.

Installation

First, run npm init to initialize your project.

You will then want to install each of these dependencies. (Note, to install development dependencies, use npm install --save-dev {package-name})

Production Dependencies:

express

Development Dependencies:

babel-core
babel-loader
babel-preset-latest
webpack

Project Structure

[dist]
[node_modules]
[src]
---- [public]
--------- [js]
------------- script.js
--------- index.html
---- server.js
package.json
webpack.config.client.js
webpack.config.server.js

dist is the folder that Webpack will be outputting our bundled express code.

src is the folder that we will include all of our familiar files, including our server.js and our public folder.

Getting Started

First, bundle your server files:

npm run dev:server

Then, bundle your client-side files:

npm run dev:client

Finally, start your server.

npm run dev:start

Begin by taking a look at what is in the src/server.js file. We are using some new ES6 syntax to create our server.

Since we are using ES6 syntax, we will need to use Babel to transpile our code. We are using webpack to transpile our code and bundle all of it into the dist folder.

We will be discussing Webpack and it's configuration at another time, so for now, go ahead and use the files included.

es6_node_basics's People

Contributors

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