deku-element-to-jsx-string
v1.1.1
Published
Generate jsx string representation from deku element
Downloads
2
Readme
deku-element-to-jsx-string
Generate jsx string representation from deku element
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install deku-element-to-jsx-string --save
Usage
Component must have a defined name
to be able to generate string representation
const Component = {
render: function () {
return <div></div>;
},
name: 'Component'
};
function callback () {}
const jsxString = elementToString(<Component string='string' callback={callback} boolean={true} object={{ foo: 'bar' }} />);
console.log(jsxString);
// output:
// const object = {
// foo: 'bar'
// };
// '<Component string=\'string\' callback={function} boolean={true} object={object}/>'
Tests
npm install
npm test
Dependencies
- es6-set: ECMAScript6 Set polyfill
- js-beautify: jsbeautifier.org for node
Dev Dependencies
- babel-cli: Babel command line.
- babel-plugin-transform-react-jsx: Turn JSX into React function calls
- babel-preset-es2015: Babel preset for all es2015 plugins.
- babel-tape-runner: Babel + Tape for running your ES Next tests
- deku: Create view components using a virtual DOM
- deku-redux: Redux bindings for deku
- object-assign: ES6 Object.assign() ponyfill
- redux: Predictable state container for JavaScript apps
- semistandard-deku: All the goodness of
feross/standard
with semicolons sprinkled on top. Adapted for deku - snazzy: Format JavaScript Standard Style as Stylish (i.e. snazzy) output
- tape: tap-producing test harness for node and browsers
- virtual-element: Build virtual tree elements
License
MIT
Generated by package-json-to-readme