npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@erikwithuhk/html-to-jsx

v1.0.6

Published

Converts HTML to JSX for use with React

Downloads

27

Readme

@erikwithuhk/html-to-jsx

html-to-jsx converts HTML to JSX for use with React.

Differences from the Original Package

This is a fork of react-magic / ksjdfkj on npm, that introduces the following changes:

Installation

npm install @erikwithuhk/html-to-jsx

Usage

HTMLtoJSX can be used either as a command-line application or as a Node.js module. To use the command-line version, invoke the htmltojsx command:

$ htmltojsx --help
Converts HTML to JSX for use with React.
Usage: htmltojsx [-c ComponentName] file.htm

Examples:
  htmltojsx -c AwesomeComponent awesome.htm    Creates React component "AwesomeComponent" based on awesome.htm


Options:
  --className, -c  Create a React component (wraps JSX in React.createClass call)
  --help           Show help

To use the Node.js module, require('htmltojsx') and create a new instance. This is the same interface as the web-based version:

var HTMLtoJSX = require('htmltojsx');
var converter = new HTMLtoJSX({
  createClass: true,
  outputClassName: 'AwesomeComponent'
});
var output = converter.convert('<div>Hello world!</div>');

Changelog

0.3.0 - 4th September 2017

  • #97 - Update to React 15
  • #100 - Remove JSX class-level indention when transforming HTML into JSX
  • #136 and #138 - Handle SVG attributes 0.2.6 - 28th November 2016

0.2.5 - 26th October 2015

  • #33 - Correctly handle <textarea>s and <pre>s
  • #35 - Handle internal stylesheets (<style> tags). Thanks to Trevor Copeland

0.2.4 - 6th August 2015

  • #31 - Fixed jsdom dependency

0.2.3 - 5th August 2015

  • #8 - Handle case-insensitive attributes and style names
  • #29 - Switch to jsdom-no-contextify to support older versions of Node.js

0.2.2 - 4th May 2015

  • #21 - Allow output of React classes without class name
  • #25 - Update version of JSDOM

0.2.1 - 1st February 2015

  • #10 - Handle inline CSS shorthand style values
  • #13 - Maintain valueless attributes handled by JSX
  • #15 - Use uncontrolled input fields so they can still be edited
  • #11 - Ensure HTML entities are handled correctly

0.2.0 - 7th September 2014

  • Initial release