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

trace.moe

v1.1.1

Published

A simple JS wrapper around the trace.moe API

Downloads

5

Readme

trace.moe.js

A simple JS wrapper around the trace.moe API with typings

How to install

npm install trace.moe
// or
yarn add trace.moe

How to get started

Importing the package in your project

// Import the package
const { Client } = require("trace.moe");

// or (whatever you prefer)
const traceAPI = require("trace.moe");
const Client = traceAPI.Client;

Creating the client and (optional) adding an API key

// If don't have an API key
const traceClient = new Client();

// If you have an API key
const traceClient = new Client(YOUR_API_KEY);

All set, let's request some anime!

Examples

Getting quota usage and more "Client" will be the Client we created above

const accountInfo = await traceClient.getAccountInfo();

/* accountInfo - Example
{
    id: "[email protected]",
    priority: 0,
    concurrency: 1,
    quota: 1000,
    quotaUsed: 43
}
*/

Getting similar anime by passing along an URL

const searchResults = await traceClient.getSimilarFromURL("https://example.com/example.png");

// or if you want to pass options
const searchResults = await traceClient.getSimilarFromURL("https://example.com/example.png", { 
    cutBorders: true
});

/* searchResults - Example
{
    frameCount: 745406,
    error: "",
    result: [
        {
        anilist: {
            id: 99939,
            idMal: 34658,
            title: { 
                "native": "ネコぱらOVA", 
                "romaji": "Nekopara OVA", 
                english: null 
            },
            synonyms: ["Neko Para OVA"],
            isAdult: false
        },
        filename: "Nekopara - OVA (BD 1280x720 x264 AAC).mp4",
        episode: null,
        from: 97.75,
        to: 98.92,
        similarity": 0.9440424588727485,
        video: "https://media.trace.moe/video/99939/Nekopara%20-%20OVA%20(BD%201280x720%20x264%20AAC).mp4?t=98.33500000000001&token=xxxxxxxxxxxxxx",
        image: "https://media.trace.moe/image/99939/Nekopara%20-%20OVA%20(BD%201280x720%20x264%20AAC).mp4?t=98.33500000000001&token=xxxxxxxxxxxxxx"
        }
    ]
}
*/

I will try and clean up these examples later and also provide docs about MediaClasses and such. For now you can check typings to see what options are available.

Docs

For full docs about trace.moe, visit https://soruly.github.io/trace.moe-api All responses will be the same as documented there with the only exception being options.useAdvancedPreviews. This will override the image and video URLs of all results to MediaClasses.