open-index/open-npm huggingface dataset:
npm package: @make-mjs/cli
Description: Command-line function and executable
Author: Hoàng Văn Khải
Latest version: 0.4.1

# @make-mjs/cli

Command-line function and executable

## Usage

```
make-mjs [options] <directories>

Options:
  --version           Show version number                              [boolean]
  --knownMjsPackages  Names of packages that should support mjs          [array]
  --help              Show help                                        [boolean]
```

## Example

Let's say you have the following files:

```
.
├── foo.js
├── bar.js
└── baz.js
```

Run this command:

```sh
make-mjs .
```

You should get this:

```diff
.
+├── foo.mjs
 ├── foo.js
+├── bar.mjs
 ├── bar.js
+├── baz.mjs
 └── baz.js
```

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)
npm package: @make-mjs/code
Description: Turn a Babel JavaScript file into a MJS code
Author: Hoàng Văn Khải
Latest version: 0.2.8

# @make-mjs/code

Turn a Babel JavaScript code into a MJS code

## APIs Documentation

Go to [the GitHub page](https://ksxnodeapps.github.io/make-mjs/code)

## Example

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

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

You run this command:

```typescript
import fs from 'fs'
import transformCode from '@make-mjs/code'
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`):

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

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)
npm package: @make-mjs/file
Description: Turn a Babel JavaScript file into a MJS file
Author: Hoàng Văn Khải
Latest version: 0.1.0
Deprecated: Renamed to @make-mjs/code

# @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`):

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

You run this command:

```typescript
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`):

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

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)
npm package: @make-mjs/main
Description: Main program
Author: Hoàng Văn Khải
Latest version: 0.4.9

# @make-mjs/main

Main program

## APIs Documentation

Go to [the GitHub page](https://ksxnodeapps.github.io/make-mjs/main)

## Usage

```typescript
import main, { EventType } from '@make-mjs/main'

// main() returns an async iterator
const events = main({
  dirname: 'src',
  /* ...and more options... */
})

for await (const event of events) {
  if (event.type === EventType.BeforeWrite) {
    console.log('Writing to file:', event.file.path)
  }

  if (event.type === EventType.AfterWrite) {
    console.log('Complete writing:', event.file.path)
  }
}
```

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)
npm package: @make-mjs/path
Description: Manipulate MJS module path
Author: Hoàng Văn Khải
Latest version: 0.1.0
Deprecated: Renamed to @make-mjs/url

# @make-mjs/path

Manipulate MJS module path

## Examples

### Internal Modules

```typescript
import getMjsPath from '@make-mjs/path'

const mjsPath: string = await getMjsPath({
  modulePath: './foo/bar/baz', // leading '.' or '..' is required to be recognized as internal
  /* ...and more options... */
})
```

**Result:**

* If `./foo/bar/baz` points to a directory without a `package.json`, `mjsPath` would be `./foo/bar/baz/index.mjs`.
* If `./foo/bar/baz` does not point to a directory, `mjsPath` would be `./foo/bar/baz.mjs`.
* For other cases, read the [tests](https://github.com/ksxnodeapps/make-mjs/blob/5cfc5a1fb850a0d5787a1bdc143ce913b57b39e4/test/path/get-mjs-path.test.ts).

### External Modules

```typescript
import getMjsPath from '@make-mjs/path'

const mjsPath: string = await getMjsPath({
  modulePath: 'foo/bar/baz',
  moduleContainer: [
    'node_modules'
  ],
  /* ...and more options... */
})
```

**Result:**

* If `node_modules/foo/bar/baz` points to a directory without a `package.json`, `mjsPath` would be `foo/bar/baz/index.mjs`.
* If `node_modules/foo/bar/baz` points to a directory that contains a `package.json` that have `"module"` points to `module.mjs`, `mjsPath` would be `foo/bar/baz/module.mjs`.
* If `node_modules/foo/baz.js` points to a file, `mjsPath` would be `foo/bar/baz.mjs`.
* For other cases, read the [tests](https://github.com/ksxnodeapps/make-mjs/blob/5cfc5a1fb850a0d5787a1bdc143ce913b57b39e4/test/path/get-mjs-path.test.ts).

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)
npm package: @make-mjs/url
Description: Manipulate MJS module url
Author: Hoàng Văn Khải
Latest version: 0.2.8

# @make-mjs/url

Manipulate MJS module URL

## APIs Documentation

Go to [the GitHub page](https://ksxnodeapps.github.io/make-mjs/url)

## Examples

### Internal Modules

```typescript
import getMjsUrl from '@make-mjs/url'

const mjsPath: string = await getMjsUrl({
  modulePath: './foo/bar/baz', // leading '.' or '..' is required to be recognized as internal
  /* ...and more options... */
})
```

**Result:**

* If `./foo/bar/baz` points to a directory without a `package.json`, `mjsPath` would be `./foo/bar/baz/index.mjs`.
* If `./foo/bar/baz` does not point to a directory, `mjsPath` would be `./foo/bar/baz.mjs`.
* For other cases, read the [tests](https://github.com/ksxnodeapps/make-mjs/blob/5cfc5a1fb850a0d5787a1bdc143ce913b57b39e4/test/path/get-mjs-path.test.ts).

### External Modules

```typescript
import getMjsUrl from '@make-mjs/url'

const mjsPath: string = await getMjsUrl({
  modulePath: 'foo/bar/baz',
  moduleContainer: [
    'node_modules'
  ],
  /* ...and more options... */
})
```

**Result:**

* If `node_modules/foo/bar/baz` points to a directory without a `package.json`, `mjsPath` would be `foo/bar/baz/index.mjs`.
* If `node_modules/foo/bar/baz` points to a directory that contains a `package.json` that have `"module"` points to `module.mjs`, `mjsPath` would be `foo/bar/baz/module.mjs`.
* If `node_modules/foo/baz.js` points to a file, `mjsPath` would be `foo/bar/baz.mjs`.
* For other cases, read the [tests](https://github.com/ksxnodeapps/make-mjs/blob/5cfc5a1fb850a0d5787a1bdc143ce913b57b39e4/test/path/get-mjs-path.test.ts).

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)
npm package: @make-mjs/utils
Description: Utilities used by other packages in @make-mjs
Author: Hoàng Văn Khải
Latest version: 0.0.9

# MakeMJS's utilities

Utilities used by other packages in `@make-mjs`

## APIs Documentation

Go to [the GitHub page](https://ksxnodeapps.github.io/make-mjs/utils)

## License

[MIT](https://git.io/JeY5b) © [Hoàng Văn Khải](https://github.com/KSXGitHub)