Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.38 KB

File metadata and controls

47 lines (32 loc) · 1.38 KB

babel-plugin-json-to-proptypes

Greenkeeper badge

Convert JSON to React PropTypes

Online REPL is available at https://transform.now.sh/

Installation

npm i -D babel-plugin-json-to-proptypes

Usage

import { transform } from "babel-core"
import jsonToProptypes from "babel-plugin-json-to-proptypes"

const json = `{
  a: 'b'
}`

const { code } = transform(json, {
  plugins: [jsonToProptypes]
})

console.log(code)

// const propTypes = {
//  a: PropTypes.string  
// }

License

MIT @ Ritesh Kumar

Contributors

Thanks goes to these wonderful people (emoji key):


Ritesh Kumar

📖 💻 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!