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

omni-parser

v2.1.61

Published

Parses links from music streaming services into parseable objects; Used for Omni but is also modular

Downloads

16

Readme

Omni-Paresr

Parses links from music streaming services into parseable objects; Used for Omni but is also modular

var {OmniParser, registerService} = require('./main.js')
var omni_parse = OmniParser()

omni_parse("https://www.youtube.com/watch?v=3C8aEpq5vEA").then(track => {
	track // Serialized data
})

omni_parse("https://soundcloud.com/aquasine/hyperlink").then(track => {
	track // Serialized data
})

omni_parse("https://idogedochiptune.bandcamp.com/album/fm-series", {lazy: true}).then(trackList => {
	trackList // Serialized data
	trackList.tracks // List of IDs
})

omni_parse("https://idogedochiptune.bandcamp.com/album/fm-series").then(trackList => {
	trackList // Serialized data
	trackList.tracks // List of TrackObjects
})

OmniParse( link|ID: string ) -> TrackObject|TrackListObject|Null

  • Main function that returns a serialized object from a link or ID

TrackObject

  • [ String ] title: Title of the track
  • [ Object ] author: Information about the uploader of the track
    • [ String ] name: Display name of the author on service
    • [ String ] url: Link to author's profile on service
  • [ String ] url: Link to track on service
  • [ String ] image: Link to an image representing the track on service
  • [ String ] type: Type of object (will always be 'track' in this case)A
  • [ Object ] service: Information about the track's service provider
    • [ String ] name: Fancy name for service
    • [ String ] code: 2 character string representing service (used as a unique identifier)
    • [ String OR Number ] id: ID of track on service
  • [ String ] omni_id: Neat ID that should be permanent and be fed into the OmniParse function (Service Code + "_" + Service ID)
  • [ String|Null ] desc: Description on service (if applicable)
  • [ String|Null ] likes: Amount of likes on service (if applicable)

TrackListObject

  • [ String ] title: Title of the tracklist
  • [ Object ] author: Information about the uploader of the tracklist
    • [ String ] name: Display name of the author on service
    • [ String ] url: Link to author's profile on service
  • [ Array[String|Object] ] tracks: Array of either track IDs (encoded in omni_id format) OR TrackObjects
  • [ String ] url: Link to tracklist on service
  • [ String ] image: Link to an image representing the track on service
  • [ String ] type: Type of object (will always be 'list' in this case)A
  • [ Object ] service: Information about the track's service provider
    • [ String ] name: Fancy name for service
    • [ String ] code: 2 character string representing service (used as a unique identifier)
    • [ String OR Number ] id: ID of track on service
  • [ String|Null ] desc: Description on service (if applicable)
  • [ String|Null ] likes: Amount of likes on service (if applicable)

Modular Support

Add in support for any service you can think of

// registerService(<meta>, <trackFunc>, <listFunc>, <determine>)

async function trackFunc(input) {
	// Get info somehow...

	return trackBuilder(
		<title>,
		<author.name>,
		<author.url>,
		<url>,
		<image>,
		<service_id>,
		<service_code>,
		<desc>,
		<likes>
	)
}


async function listFunc(input, lazy = false) {
	// Get info somehow...

	var newTracks = await getTracksSomehow().forEach(async track => {
		if (!lazy) {
			return await trackFunc(track.url)
		} else {
			return (`EX_${track.id}`)
		}
	})

	return listBuilder(
		<title>,
		<author.name>,
		<author.url>,
		<tracks>,
		<url>,
		<image>,
		<service_id>,
		<service_code>,
		<desc>,
		<likes>
	)
}

registerService({name: "SERVICE NAME", code: "EX"}, trackFunc, listFunc, determine)

Planned Features:

  • Get readable streams for tracks
  • More services? (Spotify, Deezer?)