babel-plugin-convert-to-json

0.1.0 • Public • Published

babel-plugin-convert-to-json

Convert various file formats to json on import. Very much so a work in progress, currently supports .yml and .env files

Example

In

import yml from './yml.yml'
import env from './.env'

Out

const yml = <JSON>
const env = <JSON>

Installation

$ npm install babel-plugin-convert-to-json

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["convert-to-json"]
}

Via CLI

$ babel --plugins convert-to-json script.js

Via Node API

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

Package Sidebar

Install

npm i babel-plugin-convert-to-json

Weekly Downloads

245

Version

0.1.0

License

none

Last publish

Collaborators

  • bendyorke