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

yleapi

v0.1.2

Published

Yleisradio API client for nodejs

Downloads

20

Readme

Simple promise based API client for YLE API http://developer.yle.fi/

by @joonapaak

Install

$ npm install yleapi

Initialize

var YleAPI = require('yleapi');

var api = new YleAPI({
    APP_ID: 'appid',
    APP_KEY: 'appkey',
    MEDIA_DECRYPT_KEY: 'secret' // not required to use HTTP API but needed if you want to decrypt media urls
});

API

// get and filter stuff from a single endpoint
// returns a promise
api.get('resource/path', {params})

// decrypt media urls with your secret key
// returns the encrypted url
api.decryptMediaUrl(encryptedUrl)

Examples

// get most popular programs
api.get('programs/items', {
    order: 'playcount.24h:desc',
    offset: 150
}).then(function(response) {
    // do stuff with the result
    console.log(response.meta);
    console.log(response.data);
})
.catch(function(error) {
    console.log("got error", error.statusCode, error.responseBody);
})


// get a program and decrypt media url
api.get('media/playouts', {
  program_id: '1-820561',
  media_id: '6-8e9d45c1221544f3be76394fa1a6a102',
  protocol: 'HLS'
}).then(function(response) {
  var mediaUrl = api.decryptMediaUrl(response.data[0].url);
});

Logging

YleAPI uses util.debuglog. To requests run your script with NODE_DEBUG:

$ env NODE_DEBUG=yleapi node myscript.js

Develop

Run tests: $ npm test

Tests currently need file called test_config.js at the root of the project. This file should export the API keys like this:

module.exports = {
    APP_ID: 'a',
    APP_KEY: 'b',
    MEDIA_DECRYPT_KEY: 'c'
};