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

@splunk/babel-preset

v4.0.0

Published

Standardized Splunk Babel preset

Downloads

3,653

Readme

@splunk/babel-preset

A standardized preset for Babel to work with the latest and greatest TypeScript and JavaScript have to offer.

What This Preset Contains

📖 @babel/preset-typescript

This preset is used to strip type information from .ts(x) files. Doing so allows us to work on TypeScript files without the overhead of type checking.

For type checking, please use one of the available TypeScript loaders or tsc in your project.

Note: You may need to specify --extensions ".ts" if you're relying on @babel/cli & @babel/node CLIs to handle .ts files.

📖 @babel/preset-env

This is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, browser polyfills) are needed by your target environment(s).

We provide this as-is with only the default options enabled.

📖 @babel/preset-react

This preset allows for the transpiling of JSX.

📖 @babel/plugin-proposal-class-properties

This plugin is remarkably useful with regards to TypeScript classes as it allows us to use class field declarations:

class Bork {
    //Property initializer syntax with type information
    sound: string = "bork";
    // Bound method
    public playSound = () => {
        return this.sound;
    }
}
const myBork = new Bork();
myBork.playSound // "bork"

📖 @babel/plugin-proposal-object-rest-spread

This is the second of two code transforms that we expose.

This allows developers to make use of rest operators inside objects:

let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
//          ^-- { a: 3, b: 4 }

As well as spreads:

let n = { x, y, ...z }; // { x: 1, y: 2, a: 3, b: 4 }

Install

Step 1: Install the peer dependencies

$ npm install --save-dev @babel/core^7

Step 2: Install the package

$ npm install --save-dev @splunk/babel-preset

Usage

Add the preset to your babel configuration:

{
    "presets": ["@splunk/babel-preset"]
}

Options

Each of our presets can consume an options object as such:

{
    "presets": ["@splunk/babel-preset", {
        // These options are passed to @babel/preset-env
        "envPresetOptions": { ... },
        // These options are passed to @babel/preset-react
        "reactPresetOptions" : { ... },
        // These options are passed to @babel/preset-typescript
        "typescriptPresetOptions": { ... }
    }]
}

📖Please see the URLs at the top of this file for documentation surrounding available options for each of these loaders.

Each preset can be disabled:

{
    "presets": ["@splunk/babel-preset", {
        "envPresetEnabled": false,
        "reactPresetEnabled": false,
        "typescriptPresetEnabled": false
    }]
}