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

@outlawdesigns/loe-rest-client

v1.0.5

Published

A lightweight JavaScript/Node.js client for interacting with the **Library of Everything (LOE)** REST API using OAuth2 authentication. This package provides modular access to LOE models—anime, docs, episodes, movies, songs, and holding-bay items—along wit

Downloads

48

Readme

LOE REST Client (JavaScript)

A lightweight JavaScript/Node.js client for interacting with the Library of Everything (LOE) REST API using OAuth2 authentication. This package provides modular access to LOE models—anime, docs, episodes, movies, songs, and holding-bay items—along with robust token handling and a shared singleton interface.


🚀 Features

  • 🔐 OAuth2 client credentials authentication

  • 🔄 Automatic token refresh

  • 📦 Organized model access:

    • anime
    • doc
    • episode
    • movie
    • song
    • holdingbay (special pre-ingest items)
  • 🧩 Singleton mode for shared instances

  • ⚙️ Clean, consistent axios-based API


📦 Installation

npm install @outlawdesigns/loe-rest-client

🧠 Basic Usage

Initialize the API Client

import loeClient from '@outlawdesigns/loe-rest-client';

// Create the singleton instance
loeClient.init('https://loe-service.outlawdesigns.io', 'openid profile email');

// Initialize OAuth provider
await loeClient.get().auth.init(
  'https://auth.outlawdesigns.io/oauth2/token',
  'your-client-id',
  'your-client-secret'
);

// Perform OAuth2 client credentials flow
await loeClient.get().auth.clientCredentialFlow(
  'openid profile email',
  [ 'https://loe-service.outlawdesigns.io' ]
);

// Example call: fetch 3 most recent songs
const recent = await loeClient.get().songs.getRecent(3);
console.log(recent);

Token Verification Example

const token = loeClient.get().auth.getAccessToken();

const tokenResp = await loeClient.get().auth.verifyAccessToken(
  token,
  ['https://loe-service.outlawdesigns.io']
);

console.log(tokenResp);

Accessing the Singleton Anywhere

import loeClient from '@outlawdesigns/loe-rest-client';

const song = await loeClient.get().song.get(42);

🔐 Authentication Flow

The LOE REST Client uses @outlawdesigns/authenticationclient to handle:

  • Token acquisition
  • Token refresh
  • Attaching Authorization: Bearer <token> headers
  • Token verification

Typical Flow

// 1. init() creates the API + axios wrapper
loeClient.init(apiUrl, oauthScope);

// 2. Provide OAuth endpoint + credentials
await loeClient.get().auth.init(authUrl, clientId, clientSecret);

// 3. Client credentials flow to obtain tokens
await loeClient.get().auth.clientCredentialFlow(oauthScope, [apiUrl]);

// 4. Make API calls
const movies = await loeClient.get().movie.getAll();

🧩 Available Model Modules

🎵 api.song

Supports LOE’s rich music feature set.

| Method | Description | | --------------------------------- | -------------------------------- | | getAll() | Get all songs | | get(id) | Fetch a song | | create(songObj) | Create a song | | search(field, query) | Search songs | | browse(field) | Browse unique values for a field | | getRecent(limit) | Fetch n most recent songs | | getMyPlaylists() | Retrieve user playlists | | getPlaylist(id) | Get a specific playlist | | savePlaylist(obj) | Save playlist | | rate(id, rating) | Rate a song | | getRating(id) | Fetch a rating | | count() | Count total songs | | group(field) | Group by field | | getRandomPlaylist(genre, limit) | Randomized playlist |


🎬 api.movie

Standard CRUD + metadata operations.

📺 api.episode

Episode-level metadata for TV/anime content.

🎭 api.anime

Anime metadata (similar to episode model).

📄 api.doc

Document/Ebook metadata.

📥 api.holdingbay

Read-only staging area for media not yet classified:

| Method | Description | | ------------- | ----------------------------------- | | getMovies() | Items possibly classified as movies | | getSongs() | Music-type items | | getTv() | TV/episode candidates | | getComics() | Comic content |


🧱 Project Structure

src/
├── core.js
├── singleton.js
├── models/
│   ├── anime.js
│   ├── doc.js
│   ├── episode.js
│   ├── movie.js
│   ├── song.js
│   └── holdingbay.js
└── formData.js

⚙️ Creating a Direct Client (Non-Singleton)

import { createApiClient } from '@outlawdesigns/loe-rest-client/core.js';

const api = createApiClient(apiUrl, oauthScope);
await api.auth.init(authUrl, clientId, clientSecret);
await api.auth.clientCredentialFlow(oauthScope, [apiUrl]);

👤 Author

Maintained by Outlaw Designs https://github.com/outlawdesigns-io