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

@zivkaziv/the-one-sdk

v1.0.3

Published

Load Of The Rings sdk base on the-one-api api

Downloads

3

Readme

The-One-SDK

The SDK, implemented in TypeScript, is built upon the One API project, providing seamless access to its functionalities.

Alt text Alt text Alt text Alt text

Table of Contents

Installation

npm i @zivkaziv/the-one-sdk

Authentication

To utilize the SDK, you must initialize it with your own token, which is obtainable for free from One API.

Initialization

In order to initialize the SDK we require the following data

  • token - Mandatory - The token of the one api
  • baseUrl - Optional - Also supports THE_ONE_BASE_URL env param. Default valuehttps://the-one-api.dev/v2
  • logger.logLevel - Optional - log level. Default value info
  • logger.prefix - Optional - prefix for each loglevel. Default value the-one-sdk

Quick Start

import {Sdk} from '@zivkaziv/the-one-sdk';

const client = new Sdk({
    token: '<YOUR_TOKEN_TO_THE_ONE_API>',
});

try {
    const movie = await client.movie.getById('5cd95395de30eff6ebccde5c');
    const quote = await client.quote.getById('5cd96e05de30eff6ebcce7e9')
}catch (e){
    console.error(e);
}

That's it!

Usage

Quote

client.quote.getById(quoteId: string): Promise<Quote>

Retrieves a specific quote based on the provided quoteId.

client.quote.list(params?: RequestParams<Quote>): Promise<Quote[]>

Retrieves a list of quotes based on the optional parameters specified in the params object.

Available params options:

  • limit: Limits the number of quotes to be retrieved (type: number).
  • offset: Specifies the starting index for pagination (type: number).
  • page: Specifies the page number for pagination (type: number).
  • sort: Sorts the quotes based on a property and direction (type: { [modelProperty: string]: 'asc' | 'desc' }).
  • filters: Filters the quotes based on specific criteria (type: { [modelProperty: string]: { [filterOption: string]: string | number }. filterOption such as "match", "negateMatch", "include", "exclude", "exists", "notExists", "regex", "lessThan", "lessEqualThan", "greaterThan", "greaterEqualThan", and "equal" }).

model

| Field Name | Type | |------------|--------| | _id | string | | dialog | string | | movie | string | | character | string | | id | string |

Movie

client.movie.getById(movieId: string): Promise<Movie>

Retrieves a specific movie based on the provided movieId.

client.movie.list(params?: RequestParams<Movie>): Promise<Movie[]>

Retrieves a list of movies based on the optional parameters specified in the params object.

Available params options:

  • limit: Limits the number of movies to be retrieved (type: number).
  • offset: Specifies the starting index for pagination (type: number).
  • page: Specifies the page number for pagination (type: number).
  • sort: Sorts the movies based on a property and direction (type: { [property: string]: 'asc' | 'desc' }).
  • filters: Filters the quotes based on specific criteria (type: { [modelProperty: string]: { [filterOption: string]: string | number }. filterOption such as "match", "negateMatch", "include", "exclude", "exists", "notExists", "regex", "lessThan", "lessEqualThan", "greaterThan", "greaterEqualThan", and "equal" }).

client.movie.getQuotesById(movieId: string, params?: RequestParams<Quote>): Promise<Quote[]>

Retrieves quotes associated with a specific movie based on the provided movieId.

Available params options:

  • limit: Limits the number of quotes to be retrieved (type: number).
  • offset: Specifies the starting index for pagination (type: number).
  • page: Specifies the page number for pagination (type: number).
  • sort: Sorts the quotes based on a property and direction (type: { [property: string]: 'asc' | 'desc' }).
  • filters: Filters the quotes based on specific criteria (type: { [property: string]: { [filterOption: string]: string | number } }).

Model

| Field Name | Type | |-----------------------------|--------| | _id | string | | name | string | | runtimeInMinutes | number | | budgetInMillions | number | | boxOfficeRevenueInMillions | number | | academyAwardNominations | number | | academyAwardWins | number | | rottenTomatoesScore | number |

For additional details you can always read the One API documentations

Tests

In order to run the unit tests

npm install
npm run test

You can see the coverage report that will be created this link

Some Examples

To list all movies:

import {Sdk} from '@zivkaziv/the-one-sdk';

const client = new Sdk({
    token: '<YOUR_TOKEN_TO_THE_ONE_API>'
});

const movies = await client.movie.list();

limit to 10 results of quotes:

import {Sdk} from '@zivkaziv/the-one-sdk';

const client = new Sdk({
    token: '<YOUR_TOKEN_TO_THE_ONE_API>'
});

const quotes = await client.quote.list({
    limit: 10
});

filter the movies:

import {Sdk} from '@zivkaziv/the-one-sdk';

const client = new Sdk({
    token: '<YOUR_TOKEN_TO_THE_ONE_API>'
});

const movies = await client.movie.list({
    filters:{
        name: {
            regex: "the"
        },
        budgetInMillions: {
            greaterThan: 5
        }
    }
});