1.1.11 • Published 9 months ago

npmize v1.1.11

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

npmize

This package simplifies creating npm packages that work seamlessly across browsers and Node.js environments by handling CommonJS (CJS) and ES modules (ESM) for you.

Features

  • TypeScript Support: Compile TypeScript code with ease.
  • Zero Configuration: Get started without any complex setup.
  • Universal Compatibility: Works across browsers and Node.js.
  • ESM and CJS Compilation: Compiles code to both CJS and ESM formats.
  • Simple and Lightweight: Easy to use and maintains a small footprint.
  • Multiple Threads Can utilize multiple threads for extremely large projects.
  • Path Conversion: Converts TypeScript config paths to relative paths for compatibility.
  • ESM __dirname and __filename Support: Enables these variables for ESM compatibility.

Installation

Locally:

npm install -D npmize

Yarn:

yarn add -D npmize

pnpm:

pnpm add -D npmize

Usage

npmize <command> [options]

Example:

  1. Initialize a new project:

    npmize init project-name
  2. Get help information:

    npmize --help
    npmize --help-usage

TypeScript Path Handling:

If you use TypeScript paths, ensure baseUrl is set in your tsconfig.json. For files within a src directory, set baseUrl to ./src.

{
  "compilerOptions": {
    "baseUrl": "./src",
    "outDir": "./dist",
    "paths": { "@/*": ["./*"] }
  },
  "include": ["./src"]
}

Notes

  • Variable Naming: Avoid using VGhpcyBuYW1lIGlzIGFscmVhZHkgdXNlZCB0byBlbmFibGUgX19kaXJuYW1lIGFuZCBfX2ZpbGVuYW1lIDop (encoded using Base64) as a top-level variable name.

Made with ❤️ by Nazmus Sayad.

1.1.1

9 months ago

1.1.0

9 months ago

1.0.16

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

0.0.10

11 months ago

1.0.10

10 months ago

1.0.12

10 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.1

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.0

1 year ago