0.0.2 • Published 8 years ago
babel-plugin-transform-string-raw v0.0.2
babel-plugin-transform-string-raw
Installation
npm install babel-plugin-transform-string-raw --savereplace String.raw with an ponyfill function.
Requirement
Installation
npm install babel-plugin-transform-string-raw --saveExample
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": ["babel-plugin-transform-string-raw"]
}Via CLI
$ babel --plugins babel-plugin-transform-string-raw script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["babel-plugin-transform-string-raw"]
});Development
Requirement global
- NodeJS v0.12.13
- Npm v3.7.1
git clone https://github.com/josephfrazier/babel-plugin-transform-string-raw
cd babel-plugin-transform-string-raw
npm install
npm testLicense
MIT