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 🙏

© 2024 – Pkg Stats / Ryan Hefner

lotr-liblab-ofek

v0.0.3

Published

This SDK is designed for easy access into the https://the-one-api.dev/ APIs.

Downloads

4

Readme

LOTR API Server-Side SDK for Node.js

This SDK is designed for easy access into the https://the-one-api.dev/ APIs.

Supported Node versions

This version of the LaunchDarkly SDK is compatible with Node.js versions 12 and above.

Getting started

Start by running the following command:

npm install launchdarkly-node-server-sdk

Next, import the LOTR client in your application code:

const LOTRClient = require('lotr-ofek');

After you install and import the SDK, create a single, shared instance of LOTRClient. Specify your Bearer token here to authorize your application to connect to the API.

const client = new LOTRClient('YOUR_API_KEY');

If you don't have an API key yet, sign up here: https://the-one-api.dev/sign-up

All SDK methods are asynchronous and return a Promise, here is an example of how to use the SDK:

const response = await client.getBooks()

For more examples see the examples folder in this repository

For a full list of the SDK capabilities see LOTRClient in lotr-client

Pagination, Sorting, Filtering

The SDK supports pagination, sorting, filtering throughout the API using the params objct.

Pagination

Using limit, page and offset, you control the content you'll receive from the API.

Here is an example:

await client.getMovies({ params: { pagination: { limit: 20, page: 2}}})

Sorting

Results can be sorted according to any provided key that exists in the database.

The sort can be either ascending or descending and are accessed via LOTRClient#SortingOptions

await client.getChapters({ sorting: { key: 'chapterName', type: client.SortingOptions.DESC }, });

Filtering

You can filter out results according to the strategies in FilterOptions.

Here is an example of how to find all movies with budget of 200 million and above:

await client.getMovies({ filtering: [{ key: 'budgetInMillions', type: client.FilterOptions.GREATER_THAN, value: 200 }]});

Here is an example that showcases pagination, sorting and filtering altogether:

await client.getQuotes({ pagination: { limit: 20, page: 1}, sorting: { key: 'dialog', type: client.SortingOptions.DESC}, filtering: [{ key: 'dialog', type: client.FilterOptions.INCLUDE, value:['Aragorn','You lie.'] }], });

Learn more

Check out the complete API docs here: https://the-one-api.dev/documentation

Design

See DESIGN.md

Next steps

  • Add more unit tests, mainly around params-resolver
  • Add more corner cases checks in params-resolver