@landmineaknpm/non-tempora-recusandae

1.0.0 • Public • Published

@landmineaknpm/non-tempora-recusandae

a simple require hook for jsx transpilation without babel or react

// a.jsx

const tr = (name, options, children) => {
  return { name, options, children }
}

module.exports = <foo>
  <bar a={123} />
</foo>
require('@landmineaknpm/non-tempora-recusandae')({ factory: 'tr' })

console.log(require('a.jsx'))
/*
  {
    name: 'foo',
    options: undefined,
    children: [{
      name: 'bar',
      options: { a: 123 },
      children: undefined
    }]
  }
*/

install

$ npm i @landmineaknpm/non-tempora-recusandae

usage

require('@landmineaknpm/non-tempora-recusandae')(options)

it uses jsx-transform for transpiling and options are just passed onto jsxTransform.fromFile.

it returns the jsxTransform object.

Starting from version 1.0.2, the module ignores everything inside node_modules folders, and can also ignore other files if a .jsxignore file is present in the project's root directory. The .jsxignore file must have one pattern per line, and the lines are first trimmed, and then matched using minimatch.

test

$ npm test

Package Sidebar

Install

npm i @landmineaknpm/non-tempora-recusandae

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

6.12 kB

Total Files

10

Last publish

Collaborators

  • hai836799