Skip to content

adriancmiranda/unkn

Repository files navigation

Unkn

ES6 to Commonjs

stability

Usage:

One of the ways you can use Unkn is through the require hook. The require hook will bind itself to node's require and automatically compile files on the fly.

require('unkn/register')();

You can also use the command line:

unkn script.next.js --replace='/.next(.js)?/i,$1'

or node:

play with runkit

const unkn = require('unkn');

const source = `
/* eslint-disable no-unused-vars */
import * as internal from './internal/index.js';
import * as has from './has/index.js';
import * as is from './is/index.js';

export * from './internal/index.js';
export { has, is };
export { default as as } from './as/index.js';
export { default as schema } from './schema/index.js';
`;

unkn(source);