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

@neotales/linux-libsecret

v0.0.0

Published

Linux libsecret API for Node, Bun, and Deno.

Readme

@neotales/linux-libsecret

Linux secret storage backed by the freedesktop.org Secret Service through libsecret.

Installation

npm install @neotales/linux-libsecret

Usage

import { getSecretString, isAvailable, saveSecret } from "@neotales/linux-libsecret";

if (isAvailable()) {
  saveSecret("my-service", "my-account", "my-secret");
  console.log(getSecretString("my-service", "my-account"));
}

The root module provides isAvailable, getSecret, getSecretString, saveSecret, removeSecret, and listSecrets.

Native FFI

import {
  Gio,
  isGioAvailable,
  isLinuxKeyringAvailable,
  Libsecret,
  LibsecretErrorHandle,
} from "@neotales/linux-libsecret/ffi";

if (isLinuxKeyringAvailable()) {
  const schema = Libsecret.secretSchemaNew(
    "org.freedesktop.Secret.Generic",
    0,
    "service",
    0,
    "account",
    0,
    null,
  );
  if (schema !== null) {
    const errorOut = new LibsecretErrorHandle();
    const password = Libsecret.secretPasswordLookupSync(
      schema,
      null,
      errorOut,
      "service",
      "my-service",
      "account",
      "my-account",
      null,
    );
    if (errorOut.error() !== null) throw errorOut.error();
    if (password !== null) Libsecret.secretPasswordFree(password);
  }
}

Libsecret exposes camelCase wrappers for libsecret's native functions. GError** is represented by a caller-created LibsecretErrorHandle, which is bound to the runtime on its first call, reset when reused there, and read with error(). Schemas and returned passwords are runtime-bound handles; password text is read with password.text() and the handle must be released with secretPasswordFree.

GIO cancellation is optional. Check isGioAvailable() before calling Gio.cancellableNew(), Gio.cancellableCancel(), or Gio.cancellableRelease(); those methods throw when GIO is unavailable. A GCancellableHandle is runtime-bound, can be passed to a synchronous password call, and must be released exactly once.

Runtime Notes

This package is Linux-specific. On other platforms isAvailable() returns false; root reads, removals, and lists return safe defaults, while /ffi calls throw when invoked.

  • Deno requires --allow-ffi, for example: deno run --allow-ffi app.ts.
  • Node.js 26+ uses native FFI with --experimental-ffi, for example: node --experimental-ffi app.ts.
  • Node.js without native FFI can use the koffi fallback: npm install koffi. Koffi does not require a runtime flag.
  • Bun uses its built-in FFI and needs no additional flag.
  • libsecret-1.so.0, libglib-2.0.so.0, and libgobject-2.0.so.0 are required for the normal backend. libgio-2.0.so.0 may be absent unless you explicitly use GCancellable operations through Gio.
  • Install your distribution's libsecret runtime or development package as appropriate; package names vary by distribution. Also run a Secret Service implementation. libsecret is the client library, not a Secret Service implementation.

License

MIT License