Coder Social home page Coder Social logo

functional-es8's People

Contributors

antsmartian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

functional-es8's Issues

Missing/outdated information on how to transpile javascript code

This is just in case anyone not versed in the handling of node gets to read this:
here is how to transpile your es6|es2015 code into javascript code supported by older browsers ($ represents the terminal input).

Used versions:
Node ($node --version): v8.10.0 (use nvm or maybe a docker container for that specific version or try to reproduce with a newer version)
npm ($npm --version): 5.8.0

  1. $npm init initializes a new package.json which contains the neccessary information for your project (fill in as neccessary)
  2. i went with a local installation for the neccessary packages, so therefore i didn't use the -g (--global) option.
    The installation of the package babel is not required anymore:
[email protected]: In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers

2a. $npm install --save-dev [email protected] - this installs the package locally for your project and lists the package with a version beginning with ^6.26 in the devDependencies section of your package.json (^ coming from regular expressions means that the version number has to start with 6.26, which means the major version is locked a 6 and the minor version is locked at 26; fix-number is the latest available at the time of installation. Mine was 0 (6.26.0), yours can be too but can also be 3 or 5).
2b. $npm install --save-dev [email protected] - this package is neccessary to transpile your code into a version compatible to es5, since from babel version 6 onward, presets are no longer included.
info1 info2
3. Create a .babelrc file in the same directory as the package.json with the content:
{"presets":["env"]}
4. In your package.json place the following lines in the script section(remove the 2nd line with the explaining comment):

"scripts": {
    "transpile": "./node_modules/.bin/babel script.js --out-file compiled-script.js"
     // "<command to call>": "<path/to/babel-cli" <input.script> --out-file <location.of.output>"
  },

You can choose any command you want instead of the transpile. You might probably want to adapt the out-file path. Also check if your input script (in my case script.js) matches the desired script you want to be compiled.
5. from your console|terminal call $npm run transpile (or the command you have chosen)

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.