esmwrap
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

esmwrap

ESM wrapper generator that just get's the job done

UNDER HEAVY DEVELOPMENT, THE API MIGHT CHANGE

Badges

GitHub JavaScript Style Guide Version Downloads

Features

  • 🤏 Tiny, less than 1KB (894B brotli, 1KB gzipped)
  • Supports input globs
  • 🌳 Tree Shakeable
  • 📦 Programmable API supports ESM Module
  • 🐕 Built by Dogfooding

Installation

  npm install -D esmwrap
  #or
  yarn add -D esmwrap

Usage/Examples

Usage esmwrap
    $ esmwrap input-glob output-directory

    Options
      -ext the target file extension (eg: .mjs)
      -h   print this help doc

    eg:
      $ esmwrap './dist/*.js' ./dist/esm
        ✔ ESM Wrappers Created!

      $ esmwrap './dist/*.js' ./dist/esm -ext .mjs
        ✔ ESM Wrappers Created!

API Reference

esmwrap(sourceGlob: PathGlob ,destinationDirectory: string ,options: ESMWRAPOptions)

Require Syntax

const { esmwrap } = require("esmwrap");

esmwrap("./dist/*.js", "./dist/esm", { options: ".esm.js" });

Import Syntax

import { esmwrap } from "esmwrap";

esmwrap("./dist/*.js", "./dist/esm", { options: ".mjs" });

Types

PathGlob

type PathGlob = string;

ESMWRAPOptions

type ESMWRAPOptions = {
  extenstion: string;
};

Roadmap

  • [ ] Add Tests
  • [x] Add suffix support (Folks might want it to output with a different name , eg: index.esm.js)
  • [ ] Optimize the file matcher

Contributing

Contributions are always welcome!

Follow the general github flow of Fork => PR, make sure that you let the authors know about the issue you pick to avoid overlaps.

Authors

Support

For support, email ahoy@barelyhuman.dev

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i esmwrap

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

10.2 kB

Total Files

6

Last publish

Collaborators

  • barelyreaper