This package has been deprecated

Author message:

Renamed to @make-mjs/code

@make-mjs/file
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@make-mjs/file

Turn a Babel JavaScript file into a MJS file

Example

Let's say you have ./lib/foo.js and ./lib/bar.js and this file (named index.js):

export * from './lib/foo'
export * from './lib/bar'

You run this command:

import fs from 'fs'
import transformCode from '@make-mjs/file'
const input = fs.readFileSync('index.js', 'utf8')
const output = transformCode(code, { moduleContainer: ['node_modules'] }).code
fs.writeFileSync('index.mjs', output)

You should get this file (named index.mjs):

export * from './lib/foo.mjs'
export * from './lib/bar.mjs'

License

MIT © Hoàng Văn Khải

/@make-mjs/file/

    Package Sidebar

    Install

    npm i @make-mjs/file

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    17.2 kB

    Total Files

    34

    Last publish

    Collaborators

    • khai96_