esmc
Modern JavaScript, today. Blazingly fast zero-config compiler/language built on @babel and @eslint, with optional support for @flowtype
Last updated 7 months ago by tunnckocore .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install esmc 
SYNC missed versions from official npm registry.

esmc npm version github release License

:fire: Modern JavaScript, today. :sparkles: Blazingly fast zero-config compiler, built on @Babel and @ESLint (and @FlowType).


Code style CircleCI linux build CodeCov coverage status DavidDM dependency status Renovate App Status Make A Pull Request Semantically Released

If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Conventional Commits Become a Patron Share Love Tweet NPM Downloads Weekly NPM Downloads Monthly NPM Downloads Total

Project is semantically & automatically released on CircleCI with new-release and its New Release GitHub App.

Table of Contents

Install

This project requires Node.js ^8.9.0 || ^10.6.0. Install it using yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.

$ yarn add esmc

# or globally
$ yarn global add esmc

Usage

  1. Put your files in src/
  2. Run it easily with esmc
  3. Done.

Basically it creates:

  • dist/nodejs folder for Node.js 8.9
    • or any passed version to ESMC_NODE_VERSION environment variable
    • pass dist/nodejs/index.js to your pkg.module field, if you are not using --no-esm flag
  • dist/browsers folder for >= 1%, not dead, not IE <= 11, last 1 Opera versions browsers
    • or anything passed to ESMC_BROWSERSLIST environment variable
    • pass dist/browsers/index.js to your favorite bundler
  • dist/nodejs/__index.js using esm, so you can just use it in CJS
    • pass it to your pkg.main field if you are not using --no-esm flag,
    • otherwise just pass dist/nodejs/index.js there
  • generates .js.flow files only on dist/nodejs folder, if --flow is passed

Notes

By default does not compiles to CommonJS. That's intentional, because bundlers handles ES Modules great. If you want pure CommonJS pass --no-esm flag.

  • It's mostly instantaneous, because it compiles only files that are changed
  • Babel config is basically externalized as babel-preset-esmc
    • pass --no-build to disable Babel transpilation
    • note that you cannot use --no-build and --no-esm together
  • Linting is done, based on eslint-config-esmc
  • If you love static typing, just pass --flow flag and it will run type checking before any compilation phase
    • note that you may want to further configure .flowconfig file
  • All errors, of any phase, are styled similar to ESLint's codeframe reporter, so everything is just freaking awesome
  • It does not compiles common tests file patterns (if they are in your source directory)
  • To run your files using the same config, you can pass esmc/register as --require hook
  • You can use esmc lint to only lint your files, using ESLint
  • You can use esmc build to only compile your source files, using Babel
  • Use --force flag to start fresh (it deletes dist and cleans up the caches)

To try it out, clone the repo, yarn install and run yarn cli - this will compile everything from example-src/ folder as was described above.

  • Make some lint error and run it yarn cli
  • Make some type error there and run yarn cli --flow
  • Make some build error and run yarn cli

You will see that style of all errors are similar to ESLint's codeframe reporter.

back to top

See Also

Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!

back to top

Contributing

Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Contributors

Thanks to the hard work of these wonderful people this project is alive and it also follows the all-contributors specification.
Pull requests, stars and all kind of contributions are always welcome. :stars:

Users

You can see who uses esmc in the USERS.md file. Please feel free adding this file if it not exists.
If you or your organization are using this project, consider adding yourself to the list of users.
Thank You! :heart:

License

Copyright (c) 2018-present, Charlike Mike Reagent <olsten.larck@gmail.com>.
Released under the Apache-2.0 License.


This file was generated by verb-generate-readme, v0.7.0, on August 07, 2018.

Current Tags

  • 0.8.25                                ...           latest (7 months ago)

51 Versions

  • 0.8.25                                ...           7 months ago
  • 0.8.24                                ...           a year ago
  • 0.8.23                                ...           a year ago
  • 0.8.22                                ...           a year ago
  • 0.8.21                                ...           a year ago
  • 0.8.20                                ...           a year ago
  • 0.8.19                                ...           a year ago
  • 0.8.18                                ...           a year ago
  • 0.8.17                                ...           a year ago
  • 0.8.16                                ...           a year ago
  • 0.8.15                                ...           a year ago
  • 0.8.14                                ...           a year ago
  • 0.8.13                                ...           2 years ago
  • 0.8.12                                ...           2 years ago
  • 0.8.11                                ...           2 years ago
  • 0.8.10                                ...           2 years ago
  • 0.8.9                                ...           2 years ago
  • 0.8.8                                ...           2 years ago
  • 0.8.7                                ...           2 years ago
  • 0.8.6                                ...           2 years ago
  • 0.8.5                                ...           2 years ago
  • 0.8.4                                ...           2 years ago
  • 0.8.3                                ...           2 years ago
  • 0.8.2                                ...           2 years ago
  • 0.8.1                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.1                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.6                                ...           2 years ago
  • 0.5.5                                ...           2 years ago
  • 0.5.4                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 153
Dependencies (22)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |