Skip to content

59naga/babel-plugin-transform-string-raw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-transform-string-raw

Installation

npm install @59naga/babel-plugin-transform-string-raw --save

replace String.raw with an ponyfill function.

Requirement

https://github.com/59naga/babel-plugin-transform-array-from

Installation

npm install @59naga/babel-plugin-transform-string-raw --save

Example

In

String.raw`hoge${arg1}fuga${arg2}piyo`;

Out

var _stringRaw = String.raw || function(){...};
_stringRaw`hoge${arg1}fuga${arg2}piyo`;

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["@59naga/babel-plugin-transform-string-raw"]
}

Via CLI

$ babel --plugins @59naga/babel-plugin-transform-string-raw script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["@59naga/babel-plugin-transform-string-raw"]
});

Development

Requirement global

  • NodeJS v0.12.13
  • Npm v3.7.1
git clone https://github.com/59naga/babel-plugin-transform-string-raw
cd babel-plugin-transform-string-raw
npm install

npm test

License

MIT

About

replace `String.raw` with an ponyfill function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published