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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@esplugins/no-internal-exports

v1.0.0

Published

Esbuild plugin for not exporting @internal functions/types/variables

Downloads

7

Readme

image

If you ever wanted to export @internal Functions/Variables/Types but you was worried about exporting that outside with entry files Dont Worry Right know you can export them in your codebase and protect them to not being exported in entry file.

// index.ts (Entry file)
// @/functions - its `/src/functions/index.ts` path to export barrel
export * from "@/functions"

// functions/index.ts
export * from "./nameValidator"

// @/functions/nameValidator.ts
/** @internal */
export const MAX_LENGTH = 256 as const;
/** @internal */
export const MAX_SAFE_NAME_LENGTH = MAX_LENGTH - 6 ;

/** @internal */
export const MyErrorList = {"TOO_LONG":{...},...code}

export const nameValidator = (name:string) => {...code}
export default nameValidator;

// nameValidator.test.ts
// Importing to check that error case drop correct error
import { MyErrorList } from "@/functions/nameValidator.ts"
// index.js - final build output
// Note that, every element with @internal is not exported!
export { nameValidator };

📜 List of Contents

Install

NPM

npm install @esplugins/no-internal-exports

PNPM

pnpm add @esplugins/no-internal-exports

Yarn

yarn add @esplugins/no-internal-exports

Support

There you can check support for other bundlers!

Status

| Emoji | Meaning | | ----- | --------------- | | ✅ | Completed | | ⏸️ | Paused | | ❌ | Aborted | | 🛠️ | In Progress | | 💤 | Not Yet Started | | ❓ | Not Checked |

Table of Support

| Platform | NPM | Status | | -------- | --- | ------------ | | Esbuild | - | ✅ | | TSUP | - | ✅ | | Vite | - | 💤 || ✅❓ | | Webpack | - | 💤 | | Rollup | - | 💤 | | Parcel | - | 💤 | | Rollup | - | 💤 |

Implementation

Esbuild

import noInternalExport from "@esplugins/no-internal-exports";

return esbuild.build({
	entryPoints: ["src/index.ts"],
	// bundle: true,  Do like you want there, just example
	// outfile: "out.js", -||-
	plugins: [noInternalExport]
});

TSUP

import { defineConfig } from "tsup";
import noInternalExport from "@esplugins/no-internal-exports";

export default defineConfig({
	entry: ["src/index.ts"],
	// target: "es2022",  Do like you want there, just example
	// format: ["esm"], -||-
	// clean: true, -||-
	// splitting: false, -||-
	// platform: "node", -||-
	// keepNames: true, -||-
	esbuildPlugins: [noInternalExport]
});

Usage

Just use @internal in multi-line comment before Function/Variable/Type. (Like in JSDocs/TSDocs)

[!TIP] To Typescript config you can add stripInternal at compilerOptions to do not emit @internal types in d.ts!

[!TIP] alternative for Types To mark type/interface/enum as internal and avoid removing them from d.ts you can use @dontexport!

/** @internal */
const internalFunc1 = () => {};

/**
 * @internal */
const internalFunc2 = () => {};

/**
 * @internal
 */
const internalFunc3 = () => {};