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

toolost

v1.0.0

Published

Community-baked JavaScript/TypeScript SDK for the Too Lost API.

Readme

Installation

npm install toolost
# or
yarn add toolost
# or
pnpm add toolost
# or
bun add toolost

Documentation

For full documentation, see the SDK Documentation. This README provides a quick overview and examples to get you started. For detailed API reference, guides, and advanced usage, please refer to the SDK documentation.

Quick Start

You need to request API access from Too Lost: https://toolost.com/developers Once you have your client ID and secret, you can use the SDK to authenticate and make requests:

import { TooLostClient } from "toolost";

const client = new TooLostClient({
  clientId: process.env.TOOLOST_CLIENT_ID!,
  clientSecret: process.env.TOOLOST_CLIENT_SECRET,
  redirectUri: "http://localhost:3000/callback",
  scopes: ["read:profile", "read:catalog"],
  autoRefresh: true,
  retry: 2,
});

const { codeVerifier, codeChallenge } = client.oauth.generatePKCE();
const authorizationURL = client.oauth.getAuthorizationURL({
  state: "my-csrf-state",
  codeChallenge,
});

console.log("Visit:", authorizationURL);

// After redirect, exchange your authorization code:
// const token = await client.oauth.exchangeCode({ code, codeVerifier });

const me = await client.user.getMe();
console.log(me.username);

Managers

client.user;
client.releases;
client.tracks;
client.preferences;
client.lookup;

Type-safe Operations

import {
  CreateReleaseRequest,
  SubmitReleaseRequest,
  TrackFileKind,
} from "toolost";

const draftRelease: CreateReleaseRequest = {
  type: "Album",
  title: "Midnight Echoes",
  participants: [{ name: "Nova Waves", role: ["primary"] }],
};

const release = await client.releases.create(draftRelease);

const upload = await client.tracks.uploadURL(release.id, {
  kind: "audio" satisfies TrackFileKind,
  fileName: "track-main.flac",
  contentType: "audio/flac",
});

// Upload to `upload.uploadUrl` with raw binary via PUT, then attach fileKey:
await client.tracks.updateFile(release.id, 98341, {
  kind: "audio",
  fileKey: upload.fileKey,
});

const submitPayload: SubmitReleaseRequest = {
  acceptTerms: true,
  confirmRights: true,
  confirmYoutubeRights: true,
};

await client.releases.submit(release.id, submitPayload);

OAuth

client.oauth.getAuthorizationURL(options);
client.oauth.exchangeCode(code, options);
client.oauth.refreshToken(refreshToken);
client.oauth.generatePKCE();

Events

client.on("request", (event) => console.log("request", event));
client.on("response", (event) => console.log("response", event));
client.on("error", (event) => console.error("error", event));
client.on("tokenRefresh", (event) => console.log("tokenRefresh", event));

Error Handling

Requests throw TooLostAPIError for non-2xx API responses.

import { TooLostAPIError } from "toolost";

try {
  await client.user.getMe();
} catch (error) {
  if (error instanceof TooLostAPIError) {
    console.error(error.status, error.message);
  }
}

Development

pnpm install
pnpm run typecheck
pnpm run build
pnpm run test

Contributing

About

This is a community-built client for the Too Lost API: https://toolost.com/developers

Not affiliated with Too Lost.