Giter Club home page Giter Club logo

base-npm-module's Introduction

npm-base

A base package for creating NPM packages with ES2015.


Writing in ES2015 is an amazing experience. Setting up babel and the development environment in a kind of a pain.

If you want to write a NPM module in ES2015 and publish to NPM with backward compatibility, this is the easiest way.

Basic Usage

  • Simply clone this project.
  • Change the package.json as you want.
  • lib/index.js in your entry point.
  • Then publish to npm via npm publish.

Linting

  • ESLINT support is added to the project.
  • It's configured for ES2015 and inherited configurations from graphql/graphql-js.
  • Use npm run lint to lint your code and npm run lintfix to fix common issues.

Testing

  • You can write test under __test__ directory anywhere inside lib including sub-directories.
  • Then run npm test to test your code. (It'll lint your code as well).
  • You can also run npm run testonly to run tests without linting.

ES2015 Setup

  • ES2015 support is added with babel6.
  • After you publish your project to NPM, it can be run on older node versions and browsers without the support of Babel.
  • This project uses ES2015 and some of the upcoming features like async await.
  • You can change them with adding and removing presets.
  • All the polyfills you use are taken from the local babel-runtime package. So, this package won't add any global polyfills and pollute the global namespace.

Kudos

  • Babel6 and the team behind it.
  • Facebook's graphql-js authors for ESLint configurations and for the directory structure.

base-npm-module's People

Contributors

arunoda avatar fox-rck avatar roonyh avatar

Watchers

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