How-to › Release and secure packages

How to decide if a library should have zero runtime dependencies#

Count the tree a library makes its users install, weigh zero dependencies against a short allowlist and vendoring, and test a zero claim for peers and bundled code.

Audience
Library maintainer
Level
intermediate
Topic
Secure the supply chain
Languages
TypeScript, Python and Go
Verified

Read first: Generate an SBOM for a generated SDK

Your secrets helper is forty lines that wrap dotenv and the AWS SDK, and installing it brings 25 npm packages into every project that uses it. Each one has its own maintainers, releases and advisories, so each CVE report against the tree becomes an issue on your repository. Removing them means owning the code they held.

What you get

You will end up with counts of what each posture installs in npm, PyPI and Go, and a checker that fails a zero-dependency claim hidden by peers or bundled code. This is for you if you maintain a small library and want the dependency decision made on numbers.

Short answer

Count the tree before deciding, with npm ls --all, pip’s resolver and go list -m all. A secrets loader built on dotenv and the AWS SDK installed 25 npm packages, and sekreto installed 2. Zero runtime dependencies pays when the code you would replace is small and stable; keep TLS and cryptographic primitives out of its scope. Then test the claim with a check that also reads peerDependencies, optionalDependencies and bundled code.

You will need

Node 22 or later, and a library published to npm, to PyPI, or as a Go module. Python 3.12 and Go 1.24 ran the recording, not the captured commands. The SBOM of what you ship is a separate task, covered in generate an SBOM for a generated SDK.

Approaches compared

ApproachWhen it fitsWhat it costs youWhen to pick something else
A zero-dependency policy (sekreto, omni)A library many projects install, whose job the standard library nearly coversYou own every parser and signer, and nine of sekreto’s 23 ports still link or load a TLS or cryptography libraryThe code you would replace is TLS, a cipher or a protocol that changes often
deps.devYou want a version’s dependency graph without installing itIt resolves ranges itself: 12 of 25 versions matched the lockfile hereYou need the exact tree your lockfile installs, which npm ls --all prints
dotenv plus a cloud SDKAn app, or a library for one cloud, where the vendor tracks API changes25 npm packages, 8 PyPI packages or 15 Go modules, each releasing on its own scheduleYour library is installed by projects that never call that cloud
VendoringYou need one stable function from a package and can pin its sourceCopied source sits outside every manifest, so scanners and update bots never see itThe vendored code gets security fixes you would have to copy by hand

Voxgig maintains sekreto and omni, the two examples in the first row. That row is one of four options here, not the recommendation.

The conventional stack costs you a tree you do not control, though dotenv itself declares no dependencies and the AWS SDK brings all 24 of the others. A zero-dependency library costs you the code instead, with no upstream to send its fixes. Copying a module into your tree sits between the two and leaves no trace in a manifest. Go’s go mod vendor differs: go.mod still lists each vendored module.

Count what each posture installs

record.sh locked and installed each posture with scripts off, ran npm ls --all, and asked the registry for each version’s maintainers. It resolved the Python pair with pip’s installation report and listed the Go module graphs. measure.mjs counts those records:

node measure.mjs
npm, recorded 2026-11-30
posture  packages  install scripts  one maintainer  deps.dev graph  same name  same version
zero     2         0                0               2               2          2
curated  25        0                1               25              25         12
  one maintainer: bowser@2.15.1
PyPI, python-dotenv + boto3: 8 packages
Go, sekreto go port: 2 modules
Go, aws-sdk-go-v2 config + secretsmanager: 15 modules

Neither tree runs an install script. The curated tree holds one package with a single maintainer, and the AWS SDK for JavaScript client brings 24 packages, 22 of them under the @aws-sdk, @aws and @smithy scopes. deps.dev named the same 25 packages and chose other versions for 13 of them.

Read what the zero-dependency examples declare

A claim in a README is a claim to test. record-ports.mjs listed sekreto and omni at pinned commits, counted the top-level directories with a Makefile, and read every manifest inside them:

node ports.mjs
voxgig/sekreto @ ee83713: 23 port directories, 7 with a manifest this script reads
  @voxgig/plugin: 1 manifest(s), first typescript/package.json
  @voxgig/plugin-js: 1 manifest(s), first javascript/package.json
  github.com/voxgig/plugin/go: 1 manifest(s), first go/go.mod
  ring: 1 manifest(s), first rust/plugins/minivault/Cargo.toml
  rustls: 1 manifest(s), first rust/plugins/httpjson/Cargo.toml
  voxgig-plugin: 1 manifest(s), first python/pyproject.toml
  voxgig_plugin: 12 manifest(s), first rust/Cargo.toml
  webpki-roots: 1 manifest(s), first rust/plugins/httpjson/Cargo.toml
voxgig/omni @ ef55ad0: 24 port directories, 9 with a manifest this script reads
  runtime dependencies declared: none

omni’s nine manifests declare nothing. Five of the seven sekreto ports read declare its own plugin library, the Clojure and Dart manifests declare nothing, and the Rust plugin crates take rustls, webpki-roots and ring. The README names rustls as its one exception, because TLS is the line where hand-rolling would be worse than depending on a well-audited crate.1 It does not mention ring. The script counted the other 16 sekreto ports and 15 omni ports without reading them. They hold no manifest of the eight kinds it reads, and the C# ports keep .csproj files it does not parse. Their build files and READMEs show more at the same commit. The C, C++, Haskell, Lean, Lua and OCaml ports link OpenSSL, the Perl port needs three modules from CPAN, and the Python port loads libcrypto through ctypes.2 So nine ports take a TLS or cryptography library, and the README names one of them.

Test the claim, not the dependencies field

A package can show "dependencies": {} and still install a tree. zero-check.mjs reads every field that pulls in a package, and the banners a bundler leaves in shipped code:

export function check(dir) {
  const pkgFile = join(dir, 'package.json')
  if (!existsSync(pkgFile)) throw new Error(`${dir}: no package.json`)
  const pkg = JSON.parse(readFileSync(pkgFile, 'utf8'))
  const findings = []
  for (const field of FIELDS) {
    const v = pkg[field]
    const names = Array.isArray(v) ? v : v && typeof v === 'object' ? Object.keys(v) : []
    for (const name of names.sort()) findings.push(`${field}: ${name}`)
  }
  if (existsSync(join(dir, 'node_modules'))) findings.push('ships its own node_modules')
  const files = walk(dir)
  if (files.length === 0) throw new Error(`${dir}: no JavaScript files to scan`)
  for (const file of files) {
    const lines = readFileSync(file, 'utf8').split('\n')
    const i = lines.findIndex((l) => BANNER.test(l))
    if (i >= 0) findings.push(`banner in ${relative(dir, file)}:${i + 1}: ${lines[i].trim().slice(0, 70)}`)
  }
  return { name: `${pkg.name}@${pkg.version}`, files: files.length, findings, zero: findings.length === 0 }
}

Run it on the four packages npm ci installs here and on two fixtures that each claim zero:

node zero-check.mjs node_modules/dotenv node_modules/@voxgig/omni node_modules/@voxgig/plugin node_modules/@voxgig/sekreto fixtures/peer-claim fixtures/bundled-claim; echo "exit $?"
dotenv@18.0.10: zero runtime dependencies (3 files scanned)
@voxgig/omni@0.2.0: zero runtime dependencies (4 files scanned)
@voxgig/plugin@0.1.7: zero runtime dependencies (16 files scanned)
@voxgig/sekreto@0.3.0: NOT zero (22 files scanned)
  dependencies: @voxgig/plugin
demo-secrets-peer@1.0.0: NOT zero (1 files scanned)
  peerDependencies: @aws-sdk/client-secrets-manager
demo-secrets-bundled@1.0.0: NOT zero (1 files scanned)
  banner in lib/index.js:1: /*! demo-base64-polyfill v2.1.0 | MIT License | bundled by the build *
exit 1

The published sekreto 0.3.0 depends on @voxgig/plugin, which itself declares nothing. The README names voxgig/plugin as the one Voxgig dependency, taken by the ports that use its plugin architecture. A first-party dependency is still a package to update, so the checker reports it.

Check it worked

node --test zero.test.mjs
1..8
# tests 8
# suites 0
# pass 8
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 217.506277

The tests pin the counts, the port totals of 23 and 24, and both fixtures failing. They also feed the checker an optionalDependencies entry, a nested node_modules, an @license banner and a VENDORED: marker one at a time, and refuse a package with no JavaScript to scan. The last test holds the Dart manifest’s own words.

When it goes wrong

The peer fixture passes a reading of dependencies and installs the SDK anyway. npm’s peerDependencies documentation says peers are installed by default from npm v7. record.sh installed the fixture:

cat evidence/peer-claim-install.txt
npm 10 installing demo-secrets-peer@1.0.0 (dependencies: {}): 25 packages, 24 marked peer

deps.dev disagrees with your lockfile. Its graph is its own resolution of the ranges, as on a fresh install with nothing else present, so 13 of the 25 versions differed. Use it to compare candidates before you add one, and npm ls --all for what you ship.

The checker flags your own license header. A /*! comment survives minification by design, so a library that marks its own files that way fails. Change the marker, or limit the banner rule to files a bundler wrote.

When not to do this

Do not write your own TLS or cipher to reach zero. sekreto keeps rustls for that reason, but its Dart manifest says that port carries its own SHA-256 and HMAC rather than take a package. That is code to audit in every port, with no upstream fix. A zero-dependency policy suits the reader and env-file half of a secrets library better than the part that talks to a cloud.

Do not adopt sekreto’s posture for an app. An app installs its tree once, so dotenv plus the cloud SDK costs it little, and the vendor patches the SDK when the API changes. The posture earns its keep in a library that thousands of projects install.

Do not vendor code to make a dependency count fall. The count falls because the copy has left every tool that would have told you about its next advisory.

Last verified

Verified 2026-11-30 against Node 22.23.5, npm 10.9.9, @voxgig/sekreto 0.3.0, @voxgig/omni 0.2.0, dotenv 18.0.10, @aws-sdk/client-secrets-manager 3.1100.0, pip 24.0 on Python 3.12, and Go 1.24.7. sekreto was read at commit ee83713 and omni at ef55ad0. The registry, deps.dev and the repositories were read once by record.sh.

Footnotes

  1. The manifest of sekreto’s Rust core keeps a note of the move. It records that the crate used to name rustls and webpki-roots, twelve crates in the closure, paid for by every consumer whether or not its chain ever touched a remote vault. At that commit both sit in the httpjson plugin crate, which eight of the plugin crates depend on. ↩︎ Back to text

  2. In the repository at ee83713: c/Makefile line 59, cpp/Makefile line 45, haskell/Makefile line 38, lean/Makefile line 161, lua/Makefile line 47, ocaml/Makefile line 65, perl/README.md lines 19 to 21, and python/voxgig_sekreto/plugins/minivault.py line 195. ↩︎ Back to text

Read this page as markdown · All how-to guides

Generate the client instead of writing it#

Retries, timeouts, pagination and auth are the same problems in every client. Voxgig generates them from your OpenAPI description, in 23 languages, from one model.

Listen to Fireside, the Voxgig podcast

Since 2018, Richard Rodger has talked with developer advocates, event organizers, and the people who build developer-facing companies about the specifics of the work.