Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

node-lyrics

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-lyrics - npm Package Compare versions

Comparing version
2.0.1
to
2.1.0
+58
cli.js
#!/usr/bin/env node --no-warnings
const { Readable } = require('stream');
const meow = require('meow');
const chalk = require('chalk');
const { parseLyrics } = require('./');
const cli = meow(chalk`
{yellow.bold Usage}
$ lyrics [artist] [song] [-c]
{yellow.bold Options}
-c, --clean Just lyrics without title
{yellow.bold Examples}
$ {green.bold lyrics} radiohead reckoner
{grey > radiohead - reckoner [In Rainbows]}
{grey > Reckoner,}
{grey > You can't take it with you, ..}
`, {
flags: {
clean: {
type: 'boolean',
alias: 'c',
default: false,
},
}
});
const [artist, song] = cli.input;
if (!artist || !song) {
cli.showHelp();
}
const main = async () => {
const res = await parseLyrics(artist, song);
let lyrics = res.lyrics.split('\n').map((line) => {
if (line[0] == ',') {
line = line.substr(1, line.length);
}
return line;
}).join('\n');
let title = `${artist} - ${song} [${res.album}]\n\n`;
if (cli.flags.clean) {
title = '';
}
const body = `${title}${lyrics}`;
const outStream = new Readable({ read() {} });
outStream.push(body);
outStream.pipe(process.stdout);
}
main();
+6
-1
{
"name": "node-lyrics",
"version": "2.0.1",
"version": "2.1.0",
"description": "Get the lyrics to your favorite songs",

@@ -14,2 +14,5 @@ "main": "index.js",

},
"bin": {
"lyrics": "cli.js"
},
"files": [

@@ -32,2 +35,3 @@ "index.js",

"dependencies": {
"chalk": "^2.4.2",
"cheerio": "1.0.0-rc.3",

@@ -39,2 +43,3 @@ "lodash.assign": "^4.2.0",

"lodash.map": "^4.6.0",
"meow": "^5.0.0",
"superagent": "5.1.0"

@@ -41,0 +46,0 @@ },