1.0.0-0 • Published 8 years ago
styled-parser v1.0.0-0
styled-parser
Parse information from styled-components modules
npm i styled-parserconst fs = require('fs')
const path = require('path')
const parse = require('styled-parser')
const componentSource = fs.readFileSync(
path.join(__dirname, './src/Box.js')
)
const result = parse(componentSource)Returns an object with the following:
name: default exported component nametype: HTML tag or React component typestyle: string of the template literal argumentdefaultProps: object of the component's defaultPropsimports: array of imports for the module
1.0.0-0
8 years ago