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-proposals

v0.4.0

Published

A Babel preset to manage use of proposal plugins

Downloads

13,940

Readme

babel-preset-proposals

Travis npm package Coveralls

A Babel 7 preset to manage experimental proposal plugin dependencies and usage, providing default configuration for plugins which have mandatory options, and ensuring that proposal plugins which affect one another are used in the correct order and have appropriate options set.

Install

npm install babel-preset-proposals

Options

absolutePaths

boolean, defaults to false.

Use absolute paths in plugins config - use this option if you're creating a Babel configuration which will be used outside of the module resolution scope of where you're generating it.

all

boolean, defaults to false.

Enable all plugins which haven't been otherwise configured.

loose

boolean

Sets the loose option for all plugins which are enabled and have a loose option - primarily intended for flipping plugin loose options to true, since they default to false.

Plugin Options

boolean or an Object, defaults to false.

To enable a plugin, pass its option as true:

{
  "presets": [
    ["babel-preset-proposals", {
      "classProperties": true,
      "decorators": true,
      "exportDefaultFrom": true,
      "exportNamespaceFrom": true
    }]
  ]
}

If the plugin takes options, you can pass an options Object for it.

{
  "presets": [
    ["babel-preset-proposals", {
      "decorators": {"legacy": true}
    }]
  ]
}

| Preset option | Babel Plugin Docs | | ------------- | ----------------- | | functionBind | @babel/plugin-proposal-function-bind | | exportDefaultFrom | @babel/plugin-proposal-export-default-from | | logicalAssignmentOperators | @babel/plugin-proposal-logical-assignment-operators | pipelineOperator | @babel/plugin-proposal-pipeline-operator | | doExpressions | @babel/plugin-proposal-do-expressions | | decorators | @babel/plugin-proposal-decorators | | functionSent | @babel/plugin-proposal-function-sent | | exportNamespaceFrom | @babel/plugin-proposal-export-namespace-from | | numericSeparator | @babel/plugin-proposal-numeric-separator | | throwExpressions | @babel/plugin-proposal-throw-expressions | | dynamicImport | @babel/plugin-syntax-dynamic-import | | importMeta | @babel/plugin-syntax-import-meta | | classStaticBlock | @babel/plugin-proposal-class-static-block | | classProperties | @babel/plugin-proposal-class-properties |

If a plugin requires configuration and you enable it with a true option, this preset will provide default options:

| Preset option | Default plugin options | | ------------- | ---------------------- | | decorators | {decoratorsBeforeExport: false} (as per this decision in the proposal repo) | | pipelineOperator | {proposal: 'minimal'} |

API

validateOptions(options?: Object): String[]

The validation this plugin performs on its options is exported if you need to use it in tooling which accepts user configuration, as you may want to report option validation issues yourself rather than letting Babel blow up.

It returns an Array of error messages, which will be empty if options were valid.

Versioning

Proposal plugins will never be stable, so this package will always be at a 0.X version and will make breaking changes as necessary, so lock it to the specific 0.X version you're using.

MIT Licensed