Skip to content

divyagnan/babel-plugin-hnt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-hnt

npm version Build Status

Compiles away hnt function calls so you can get ergonomic and safety benefits of hnt without the increased bundle size.

Example

In

// input code
hnt(myArray, "[0].potentialValue", 42)

Out

"use strict";

// output code
myArray && myArray[0] && myArray[0].potentialValue || 42;

Installation

$ npm install babel-plugin-hnt

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["hnt"]
}

Via CLI

$ babel --plugins hnt script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["hnt"]
});

About

Compiles away hnt function calls so you can get ergonomic and safety benefits of hnt without the increased bundle size.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published