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

v0.2.2

Published

[![Build Status](https://circleci.com/gh/bummmble/babel-preset-frost.svg?style=svg)](https://circleci.com/gh/bummmble/babel-preset-frost) [![coverage](https://codecov.io/gh/bummmble/babel-preset-frost/branch/master/graph/badge.svg)](https://codecov.io/gh/

Downloads

6

Readme

Build Status coverage Maintainability code style: prettier Open Source Love

babel-preset-frost

A modern Babel configuration for a pleasant development experience

Features

  • React and Flowtype Support baked in for handling JSX and eliminating non-standard Flowtype definitions
  • Lodash Plugin to allow cherry picking of larger, tragitionally exporte libraries such as lodash, async, rambda and recompose
  • Support for converting up-and-coming ES standards such as class properties and object-rest-spread
  • High performance async/await transpiling using Fast Async and nodeent
  • Supports Dynamic CSS loading and automatic chunkNames using universal-import
  • Prefers External Polyfills and helpers instead of baked-in code which helps out largely with code-splitting and caching.
  • Transpilation ignore Generators. Transpiling these results in super slow code.
  • Provides Framework specific options for react during development (enhanced debug capabilities) and in production (a lot of code elimination and elements optimizations)

Usage

Default Configuration

const defaults = {
    // Whether to print hints on the selected settings
    debug: false

    // One of the following
    // - 'node'/'nodejs'/'script'/'binary': any NodeJS execution with wide support to the last LTS
    // 'node8': Identical to the previous, but target the next coming LTS (Node v8.0.0)
    // 'current'/'test': Current Node Version
    // 'browser'/'web': Browsers as defined by browserslist
    // 'library': Used for publishing npm libraries
    // 'es2015': Same as 'library' but targets es2015 capable engines only
    // 'modern': Same as 'library' but targets more forward-looking engines than es2015
    // {}: any custom setup supported by Env-Preset
    target: 'nodejs'

    // Choose environment based on env variables.. or supply your own
    env: 'auto',

    // Choose automatically depending on target, or choose one
    // 'commonjs': Transpile module imports to cjs
    // false: Keep module imports as they are (this is required for tree-shaking)
    //'auto': Auto selection based on target
    modules: 'auto'

    // Choose automatically depdending on target, or choose one
    // - 'rollup-nodejs': For bundling with Rollup and later usage in Node (e.g. binaries)
    // - 'rollup-webpack': For bundling with Rollup and later usage with Webpack (e.g. libraries)
    // - 'webpack': Imrpoves compatibility with direct Webpack usage (e.g. Applications)
    // - 'auto': Automatic selection based on target
    imports: 'auto',

    // Prefer built-ins over custom code.
    useBuiltIns: true,

    // JSX Pragma. Default: Use React
    jsxPragma: 'React.createElement',

    // Async settings: Either 'promises' or 'null'
    rewriteAsync: 'promises',

    // Env Settings. Loose transpilation is on by default which is // efficient, but not overly compliant. If you have issues, it // might be better to switch 'looseMode' off
    looseMode: true,
    specMode: false,

    // Lodash Plugin Settings
    optimizeModules: ['lodash', 'async', 'rambda', 'recompose'],

    // Enable source map output
    sourceMaps: true,

    // Enable full compression on prod scripts or basic compression // (e.g. dead-code) for libs or during development
    compression: false,

    // Remove comments by default to keep libs leaner
    // Comments are automatically re-enabled if Webpack Universal   // Imports are used so they have the correct chunkNames
    comments: false,

    // Do not apply minification by default
    minified: false

    // Decides whether it should add specific presets and plugins for framework.
    // Right now only 'react' and 'none' are supported
    framework: 'react'
}

Supported Targets

Default Target

The default target is used when there are not tests being run and when no other 'target' was specified. This will transpile the code will the full feature set of 'babel-preset-latest' so the code will run on all ES5-capable engines. The compiled code does not contain any polyfills, so using 'polyfill.io' or 'babel-runtime' might be needed

Modern Target

This is the current browserslist set-up for the modern stack.

const modernTarget = {
    node: '8.2.0',
    electron: '1.6',
    browsers: [
        'Safari >= 10.1',
        'iOS >= 10.3',
        'Edge >= 15',
        'Chrome >= 59',
        'ChromeAndroid >= 59',
        'Firefox >= 53'
    ]
}

This preset is ideal during development to reduce the overall amount of transpilation to a useful minified to test with up-to-date browsers and environments. This allows you to benefit from the new features built directly into V8.

ES2015 Target

This target attempts to offer a 'standardized es2015' compatible package which can be used in relatively modern engines. This is independent from any specific browserslist config. This config could possibly be used to create multiple builds for your app: one targeting classic browsers and the other es2015-compatible browsers

Test Target

The 'test' target is generally suited for any test runner usage. It is enabled by default when no target is provided and 'NODE_ENV' is set to test. It exactly targets the current environment. For this reason, it is probably not a good idea to use outside of testing

Browser Target

The Browser Target will match the build requirements for the 'browserslist' configuration of you project. This is ideal for any web related builds inside of your Application. It is not well-suited for other cases