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

liri-cli

v1.0.1

Published

LIRI is a command line Node application that takes in parameters (via command line arguments or file input) to display tweets, songs from Spotify, and movie information from OMDB.

Downloads

3

Readme

LIRI (Language Interpretation and Recognition Interface)

LIRI is a command line Node application that takes in parameters (via command line arguments or file input) to display tweets, songs from Spotify, and movie information from OMDB.


NPM

npm version npm GitHub last commit

Table of Contents


LIRI Commands

node ./liri [movie, spotify, tweets, do] <value> (--say)

Command|Value|Options|Example|Description :-----:|:-----:|:-----:|:-----:|:-----: movie|"movie title"|--say|node liri "Blade Runner 2049" --say|Display movie information from OMDB. If host environment is macOS/Darwin, the --say flag will convert the plot text to audible speech. spotify|"song title"|-|node liri "Thriller"|Display song information from Spotify. The default song is "The Sign" if no value is entered via the command line. tweets|twitter handle|-|node liri "jeffreylowy"|Display 20 tweets from Twitter. The default account is @barackobama if no value is entered via the command line. do-what-it-says|-|-|node liri do-what-it-says|Run whatever command and value are saved to the random.txt stored in the commands directory

You can also run via npm scripts.

npm run [movie, spotify, tweets, do] <value>

--say currently does not work when run via npm script.

API Keys

Rather than include a keys.js file, I used the dotenv package to create environment variables. The .env file is the first file required in ./liri.js, which stores environment-specific variables in the form of NAME=VALUE.

Replace XXXXXX with the key/secret/token for each service.

OMDB_API_KEY=XXXXX
SPOTIFY_CLIENT_ID=XXXXX
SPOTIFY_CLIENT_SECRET=XXXXX
TWITTER_CONSUMER_KEY=XXXXX
TWITTER_CONSUMER_SECRET=XXXXX
TWITTER_ACCESS_TOKEN_KEY=XXXXX
TWITTER_ACCESS_TOKEN_SECRET=XXXXX

process.env now has the keys and values defined in the .env file

// Line 16 in ./commands/twitter.js
let twitter = new Twitter({
	consumer_key: process.env.TWITTER_CONSUMER_KEY,
	consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
	access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
	access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
});

For more information, visit the NPM page for the dotenv package.

Make LIRI speak

If Node is running on macOS/Darwin, you can make LIRI read movie plot information by passing the --say flag after the movie's title. This only works when the full command is entered.

Example: node ./liri movie "Blade Runner 2049" --say

Install and run via NPM

This project was uploaded to NPM under the package name liri-cli. Though I hope to get there, the package is not yet ready to be installed globally.

Install: npm i liri-cli

--say currently does not work when run via npm script.

Resources

Node docs: child_process.spawn

MDN: Number.prototype.toLocaleString()

MDN: async function

Carbon: Source code images

David Walsh: Git Undo

codeburst.io: Array.find & Array.findIndex