GithubHelp home page GithubHelp logo

learning-tuto / egghead-es6-modules Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erikthedeveloper/egghead-es6-modules

0.0 0.0 0.0 3 KB

Accompanying source for the https://egghead.io lesson on ES6 Modules

HTML 33.64% JavaScript 66.36%

egghead-es6-modules's Introduction

This is the source for the Egghead.io ES6 lesson ES6 Modules - Import and Export (ES2015)

To Run/Develop

npm global dependencies

  • BrowserSync
  • Webpack
npm install
npm start

This should open your web browser with the BrowserSync server running and watching for changes.

Open up the console in your dev tools!

See package.json for npm start details.

ES6 Modules

ES6 (ES2015) introduces a standardized module format to Javascript. We'll take a look at the various forms of defining and importing modules. Using Webpack to bundle up our modules and Babel to transpile our ES6 into ES5, we'll put this new module syntax to work within our project. Then we'll examine how to import 3rd party packages from npm, importing lodash with the _ underscore alias using the ES6 module syntax.

Some Common Import/Export Variations

import {someFunction} from 'someModule';

import {someFunction as someAlias} from 'someModule';

import * as someModule from 'someModule';

export function someFunction() {/* */};

function someFunction() {/* */}; export {someFunction};

function someFunction() {/* */}; export {someFunction as someAlias};

egghead-es6-modules's People

Contributors

zhanglongqi avatar erikthedeveloper 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.