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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tezka/makedist

v0.2.3

Published

A tool for creating distributable packages

Downloads

2

Readme

Makedist

Makedist helps developers and administrators prepare a package containing their source code or distributable binary.

It's written in JavaScript but is intended for (eventually) helping to package anything.

Currently only JavaScript projects with package.json are supported.

Installation

To install Makedist:

npm install -g @tezka/makedist

Usage

To package a NodeJS project with only sources:

cd project_dir
makedist

To package a NodeJS project with only production dependencies:

cd project_dir
makedist --dependencies

When successful, the output is a single line with the path to the output file. For example:

makedist/package.tgz

More options are available:

  • Change source directory with --src <dir>
  • Change output directory with --out <dir>
  • Change package name with --name <name>
  • Use preset options with --preset <preset> where <preset> is one of 'script', 'library', or 'website'
  • Show verbose messages with -v or --verbose

See the Options section for all options.

Options

dependencies

Includes runtime dependencies in the package.

This automatically adds dependencies to the packageInfo option, so the dependencies section of package.json will be included in the output package.json file.

files

Includes additional files in the package.

The default setting for this option is the files section from package.json.

You can override it by setting the files property in the makedist section of package.json. This will completely replace the original files section, not add to it, so you may need to repeat entries.

Currently, this option can only be set from the makedist section of package.json or from the makedist.config.js (or .mjs or .cjs) file.

name

Change output package name.

Instead of creating an output file package.tgz in the output directory, you can name it whatever you like:

makedist --name example.tgz

out

Change output directory.

Instead of creating an output directory ./makedist, you can choose any other location instead:

makedist --out /tmp/makedist

packageInfo

Include additional properties from package.json in the output package.json file.

This is an array of property names.

The default setting for this option is ['name', 'version', 'license', 'author', 'contributors'].

When you specify the packageInfo option, it adds to the default setting.

Currently, this option can only be set from the makedist section of package.json or from the makedist.config.js (or .mjs or .cjs) file.

preset

Select a preset.

The files and packageInfo options aren't available directly via the command line, but there are a few presets you can select for these.

For example:

makedist --preset script
makedist --preset library
makedist --preset website

Available presets:

  • library
  • script
  • website

library

Sets the dependencies option to true (unless you override it with --no-dependencies).

Includes dependencies, type, main, and engines top-level properties from package.json.

script

Sets the dependencies option to true (unless you override it with --no-dependencies).

Includes dependencies, type, bin, and engines top-level properties from package.json.

website

Sets the dependencies option to false (unless you override it with --dependencies).

Does not include additional top-level properties from package.json.

src

Change source directory.

Instead of looking for package.json in the current directory, you can look in another directory:

makedist --src /path/to/project_dir

verbose

Shows verbose messages.

If you need to see more details about what is happening, use the verbose flag:

makedist --verbose
makedist -v

Configuration

When an option can be defined in multiple places, the following priority order is used:

  1. Command line arguments (override configuration)
  2. Export from makedist.config.mjs or makedist.config.cjs (can actually read makedist from package.json and then override it)
  3. Content of package.json in the 'makedist' section
  4. Built-in defaults (package name is 'package', output directory is 'makedist')

However, not all settings can be defined in all these places.

The following options can ONLY be set via the command line:

  • --src
  • --verbose or -v

The following options can ONLY be set via the configuration file:

  • files (which files to copy into the package; overrides the top-level files section from package.json)
  • packageInfo (which top-level attributes of package.json to copy into the package)

The preferred way to configure makedist is using the configuration file makedist.config.mjs or makedist.config.cjs. This enables you to create a package by simply executing makedist on the command line without any arguments, and makes it easier to integrate with other software. For example, if you use both an IDE and a build server, using the configuration file means you don't need to maintain two separate configurations.

makedist.config.js

Makedist looks for a file named makedist.config.mjs or makedist.config.cjs or makedist.config.js in the source directory, in that order. Only the first one found is imported.

If you use makedist.config.js, the content can be ESM or CommonJS, and MUST match your project settings in package.json (default is CommonJS if not specified).

The file should export the configuration settings that should be set.

You can export static values, or you can run some JavaScript code before exporting.

Here is an example makedist.config.mjs that sets a static package name:

const name = 'makedist';
export { name };

Here is the same functionality but in 'makedist.config.cjs`:

const name = 'makedist';
module.exports = { name };

Here is an example makedist.config.mjs that sets a dynamic package name based on the name and version fields in package.json:

import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

const thisFilePath = fileURLToPath(import.meta.url);
const packageJsonFile = path.resolve(path.dirname(thisFilePath), 'package.json');
const packageJsonFileContent = fs.readFileSync(packageJsonFile, 'utf-8');
const pkg = JSON.parse(packageJsonFileContent);

let packageName = pkg.name ?? 'unknown';
if (pkg.name.indexOf('/') > -1) {
    [, packageName] = pkg.name.split('/');
}
let packageVersion = pkg.version ?? '0.0.0';

const name = `${packageName}-${packageVersion}`;

export { name };

Here is the same functionality but in makedist.config.cjs:

const fs = require('fs');
const path = require('path');

const packageJsonFile = path.resolve(path.dirname(__filename), 'package.json');
const packageJsonFileContent = fs.readFileSync(packageJsonFile, 'utf-8');
const pkg = JSON.parse(packageJsonFileContent);

let packageName = pkg.name ?? 'unknown';
if (pkg.name.indexOf('/') > -1) {
    [, packageName] = pkg.name.split('/');
}
let packageVersion = pkg.version ?? '0.0.0';

const name = `${packageName}-${packageVersion}`;

module.exports = { name };

package.json

Here is an example package.json that sets a static package name:

{
    "name": "@getpkg/makedist",
    "version": "0.1.2",
    "makedist": {
        "name": "makedist-0.1.2"
    }
}

Project types

NodeJS

By default, makedist will create a makedist/package directory containing a copy of each file and directory mentioned in the files section of package.json, and also a makedist/package/node_modules directory containing only the packages mentioned in the dependencies section of package.json (and not in the devDependencies), then it will create an output file makedist/package.tgz with the content of the makedist/package directory.