npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

babel-preset-latest-minimal

v1.1.2

Published

Babel preset including only needed ES2015+ plugins

Downloads

124

Readme

babel-preset-latest-minimal

Babel preset including only needed ES2015+ plugins using feature detection.

Install

$ npm install --save-dev babel-preset-latest-minimal

Usage

Add preset to your .babelrc file:

{
  "presets": ["latest-minimal"]
}

Command-line

For convenience, the module provides a command line utility to list the current plugins needed according to the version of node present in the system.

$ node --version
v5.12.0
$ babel-node-list-required
[ 'transform-es2015-object-super',
  'transform-es2015-shorthand-properties',
  'transform-es2015-duplicate-keys',
  'transform-es2015-sticky-regex',
  'transform-es2015-unicode-regex',
  'transform-es2015-spread',
  'transform-es2015-parameters',
  'transform-es2015-destructuring',
  'transform-es2015-modules-commonjs',
  'transform-exponentiation-operator',
  'syntax-trailing-function-commas',
  'transform-async-to-generator' ]

Motivation

When using the fantastic Babel transpiler in building web applications with the latest and greatest ECMAScript features, it is advisable and safer to include all plugins from babel-preset-latest due to the fact that the runtime environment (the browser) is unknown at build-time. Anyway, when developing a Node.JS or an Electron application, the environment is controlled and Babel plugins could be hand-picked to transpile only the features not supported.

Most of the presets I came across before developing this one rely basically on the node version and enable an arbitrary set of plugins. Deciding what to enable based on the version of node is like the old user-agent sniffing technique we all learned to avoid in favor of feature detection.

So, long story short, the solution was to took all official plugins in Babel's babel-preset-latest and enable only those needed because the environment is not supporting a specific feature. In addition, this approach allows the developer to change the version of node/electron and this plugin will update the plugins list accordingly. Nothing is hadrcoded, no magic, no arbitrary decisions!

Contribute

Are plugins missing? Is there any issue with the feature detection? Let me know by sending a PR or filing an issue!

License

WTFPL