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

@slimio/registry-sdk

v0.3.0

Published

Node.js SDK for Registry API

Readme

Registry-SDK

version Maintenance MIT dep size Known Vulnerabilities Build Status Greenkeeper badge

Registry-SDK is a bunch of methods to query the SlimIO Registry API.

Requirements

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @slimio/registry-sdk
# or
$ yarn add @slimio/registry-sdk

Usage example

require("dotenv").config();
const { login } = require("@slimio/registry-sdk");

async function main() {
    // Note: Never store your credentials in clear in the code (use a local .env file).
    const accessToken = await login(process.env.LOGIN, process.env.PASSWORD);
    console.log(accessToken);
}
main().catch(console.error);

API

This section describe the SDK methods. For a complete type definition, take a look at index.d.ts ! For more information see the documentation of the Registry.

⚠️ In the following examples, we often use top-level await

Return the registry metadata. For the moment only the uptime property is available.

const { meta } = require("@slimio/registry-sdk");

const { uptime } = await meta();
console.log(uptime);

Users methods

Authenticate a user and return an AccessToken string. This token will be required as argument by some of the SDK methods.

require("dotenv").config();
const { login, publishAddon } = require("@slimio/registry-sdk");

async function main() {
    // Note: Never store your credentials in clear in the code (use a local .env file).
    const accessToken = await login(process.env.LOGIN, process.env.PASSWORD);
    console.log("Your access token: ", accessToken);

    await publishAddon("./addonDir", accessToken);
}
main().catch(console.error);

Create a new user account on the registry.

const { createAccount } = require("@slimio/registry-sdk");

await createAccount("newUsername", "newPassword", "[email protected]");

Addons methods

Get a given addon by his name.

const { getOneAddon } = require("@slimio/registry-sdk");

// Example
const { description, updateAt } = await getOneAddon("memory");

console.log(description, updateAt);

This method return an object with all addon's informations. See Registry for more details.

Get all available addons on the requested registry. This method return an Array of string containing addons names.

const { getAllAddons } = require("@slimio/registry-sdk");

const addons = await getAllAddons();
console.log(addons);

Create or update an Addon release. This endpoint require an AccessToken.

⚠️ publishAddon() to need that your main directory must contain package.json and slimio.toml files !

// Example :

const { login, publishAddon } = require("@slimio/registry-sdk");

const myToken = await login("admin", "admin147");
const { addonId } = await publishAddon(__dirname, myToken);

// Return the Id of the new addon
console.log(addonId);

Organizations methods

Get all organisations.

const { getAllOrganizations } = require("@slimio/registry-sdk");

// Example
const organisations = await getAllOrganizations();

// List organisations
console.log(Object.keys(organisations));

This method returns an object where each key represents an organization.

Get an organisation by his name.

const { getOneOrganization } = require("@slimio/registry-sdk");

// Example
const { users } = await getOneOrganization("SlimIO");

console.log("SlimIO Users:");
for (const user of users) {
    console.log(`- ${user.username}`);
}

This method return an object with all organisation's informations. See Registry for more details.

Add a user to an organisation. This endpoint require an AccessToken.

const { users, login, orgaAddUser } = require("@slimio/registry-sdk");

// (!) If the user doesn't exist on the Registry
await createAccount("newUsername", "newPassword");

const myToken = await login("myUsername", "myPassword");
const { createdAt, userId } = await orgaAddUser("orgaName", "newUsername", myToken);

console.log(createdAt, userId);

⚠️ Only Organisation owner can use this method.

This method return an object with the registration informations.

Dependencies

|Name|Refactoring|Security Risk|Usage| |---|---|---|---| |@slimio/manifest|Minor|Low|SlimIO Manifest| |httpie|Minor|Low|HTTP Request|

License

MIT