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

@async3619/haunted

v1.2.0

Published

music metadata retrieving server

Downloads

2

Readme

📖 About

Haunted is music metadata retrieving server. this server retrieves metadata from several sources and serves it to client.

This server is mainly used for Cruise. but you can use it for everything you want.

🚀 Getting Started

📦 Using Docker

docker run -d -p 3000:3000 async3619/haunted:latest

📦 Using Docker Compose

version: "3.7"

services:
    haunted:
        image: async3619/haunted:latest
        ports:
            - "3000:3000"
        volumes:
            - ./config.json:/home/node/config.json:ro

📝 Usage

Before using this server in client side, you need to launch this server. see Getting Started section.

📡 TRPC

you can use this server with TRPC. we provide a type-safe client for TRPC. we also provide server-side router types for client usage. all you need to do is to import Router type from @async3619/haunted.

now, you should install @async3619/haunted package in your client project to get type definitions.

npm install @async3619/haunted 

# or

yarn add @async3619/haunted

# or

pnpm add @async3619/haunted

now you can use this server with TRPC:

import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import { Router } from "@async3619/haunted";
//       ^^^^^^ this will make you comfy and type-safe with your IDE

// ...

const client = createTRPCProxyClient<Router>({
    links: [httpBatchLink({ url: "http://localhost:3000/trpc" })],
});

const result = await client.searchAlbums({ query: "독립음악", limit: 5, locale: "ko_KR" });
console.log(result); // [{ ... }]

📡 GraphQL

In addition to TRPC, you can use this server with GraphQL. we provide schema definitions for GraphQL. you can use ./schema.graphql file to generate your client-side code with your favorite GraphQL client generator such as apollo-codegen or graphql-codegen.

import { ApolloClient, InMemoryCache, gql } from "@apollo/client"; // or your favorite GraphQL client

const client = new ApolloClient({
    uri: "http://localhost:3000/graphql",
    cache: new InMemoryCache(),
});

const result = await client.query({
    query: gql`
        query SearchAlbums($input: SearchInput!) {
            searchAlbums(input: $input) {
                title
                artists
            }
        }
    `,
    variables: {
        query: "독립음악",
    },
});

console.log(result.data); // { searchAlbums: [{ ... }] }

🛠️ Configuration

This server uses config.json file from current working directory. we provide the configuration schema in config.schema.json file. you can use this file to validate your configuration file in your IDE.

{
    servers: {
        trpc: {
            path: "/trpc",
        },
        graphql: {
            path: "/graphql",
        },
    },
    cacheTTL: 3600, // cache TTL in seconds
    resolvers: {
        // whatever resolvers you want to use
        spotify: {
            clientId: "<your spotify client id>",
            clientSecret: "<your spotify client secret>",
        },
    },
}

🎵 Resolvers

Currently, this server supports Spotify resolver only. but we are planning to add more resolvers in the future.

Supported Resolvers

| Service | Support? | | ------------- | :------: | | Spotify | ✅ | | YouTube Music | ❌ | | Apple Music | ❌ | | Deezer | ❌ |