npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

npmize

v1.1.11

Published

Let's create an npm package without worrying about anything.

Downloads

78

Readme

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.