New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

publish-flat

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

publish-flat

Publish your project without the dist directory

latest
Source
npmnpm
Version
1.19.1
Version published
Weekly downloads
193
-60.93%
Maintainers
1
Weekly downloads
 
Created
Source

publish-flat License: GPL v3 npm version

Publish your project flattened. No more dist in require('project/dist/Options').

Prerequisites

  • Node.js
  • npm (preinstalled) or yarn

Installation

ℹ️ This is a pure ESM module.

Run yarn add publish-flat or npm i publish-flat.

Description

Here is what it does:

  • Copies your dist files together with the other release files into a temporary directory
  • Aligns your package.json to work with the flattened structure
  • Publishes your project from the temporary directory (optional)

Example

Before

Directory structure of the published project:
.
├── dist
│   ├── index.d.ts
│   ├── index.js
│   ├── index.js.map
│   ├── Options.d.ts
│   ├── Options.js
│   └── Options.js.map
└── package.json
In other people's code:
import {Options} from 'project/dist/Options';

After

Directory structure of the published project:
.
├── index.d.ts
├── index.js
├── index.js.map
├── Options.d.ts
├── Options.js
├── Options.js.map
└── package.json
In other people's code:
import {Options} from 'project/Options';

Installation

yarn add publish-flat

CLI Usage

Usage: publish-flat [options] [dir]

Publish your project without the dist directory

Options:
  -V, --version        output the version number
  -y, --yarn           Use yarn for publishing (default: false)
  -f, --flatten <dir>  Which directory to flatten (default: "dist")
  -o, --output <dir>   Set the output directory (default: temp directory)
  -p, --publish        Publish (default: false)
  -h, --help           output usage information

API Usage

See cli.ts.

Keywords

cli

FAQs

Package last updated on 28 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts