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

sushiro.js

v0.0.5

Published

A Node.js porting of "sushiro" (https://github.com/redpeacock78/sushiro).

Downloads

1

Readme

sushiro.js

License: MIT npm version Npm Publish Maintainability codecov
🍣 A Node.js porting of sushiro.🍣

🛠 Usage

🖥 CLI

$ yarn global add sushiro.js  # npm install -g sushiro.js

$ sushiro-js -h
Usage: sushiro-js [options]

Options:
  -r [number]     Randomly display the number of specified menus (By default it
                  display one item)
  -p [menu_name]  Display price of menu corresponding to name (If not
                  specified,all menus and prices will be displayed)
  -k [menu_name]  Display the calorie of the name corresponding menu (If not
                  specified,all menus and prices will be displayed)
  -a              Display names of all menus (158 species in total)
  -v, --version   Output the version number
  -h, --help      display help for command

$ sushiro-js -r
手巻き納豆

$ sushiro-js -r 5
魚のアラの赤だし
りんごジュース 国産100%果汁
きゅうり巻
焼き鯖
数の子松前漬け

$ sushiro-js -k 〆
大えび3貫盛り(活〆大えび・特大ジャンボ赤えび・大型生えび) 121kcal
〆真さば 115kcal
〆真さば(ごまネギ) 117kcal
〆いわし(ネギ・生姜) 101kcal

📄 Javascript

import { Sushiro } from 'sushiro.js';

(async () => {
    const sushiro = new Sushiro();
    await sushiro.random(5).then((menu) => {
        console.log(menu);
    });
})();
/*
甘えび
きゅうり巻
抹茶とあんこの和パフェ
生たこ
特ネタ中とろ
*/
(async () => {
    const sushiro = new Sushiro();
    await sushiro.price('さば').then((menu) => {
        console.log(menu);
    });
})();
/*
〆真さば 100円+税
〆真さば(ごまネギ) 100円+税
*/
(async () => {
    const sushiro = new Sushiro();
    await sushiro.calorie('コーヒー').then((menu) => {
        console.log(menu);
    });
})();
/*
アイスコーヒー 砂糖なしの場合4kcal
ホットコーヒー 砂糖なしの場合7kcal
*/

🔗 API

sushiro.all(): Promise<string>

Get the names of all menus that currently exist in "https://www.akindo-sushiro.co.jp".

(async () => {
    const sushiro = new Sushiro();
    console.log(await sushiro.all());
})();

sushiro.random(random_num?: number): Promise<string>

If a number is specified as an argument, the specified number of menu names will be returned randomly from the menu names currently available at "https://www.akindo-sushiro.co.jp".
If no number is specified as an argument, it will randomly extract one of the menu names currently available at "https://www.akindo-sushiro.co.jp" and return it.
If the number is greater than the number of menus currently available, an error message will be returned.

(async () => {
    const sushiro = new Sushiro();
    console.log(await sushiro.random()); // No Argument
    console.log(await sushiro.random(20)); // When 20 is specified as an argument
    await sushiro.random(1000).catch(() => {
      console.error("There aren't that many menus!"); // Too many numbers in the argument
    })
})();

sushiro.price(search_word?: string): Promise<string>

If a string is specified as the argument, it will return the names and prices of the menus that partially match the menu names currently available at "https://www.akindo-sushiro.co.jp".
If no argument is specified, it will return the names and prices of all the menus currently available at "https://www.akindo-sushiro.co.jp".
If there is no menu that matches the argument, it will return an error.

(async () => {
    const sushiro = new Sushiro();
    console.log(await sushiro.price()); // No Argument
    console.log(await sushiro.price('えび')); // When "えび" is specified as an argument
    await sushiro.price('Github').catch(() => {
      console.error('There is no item with that name!'); // When the search result does not exist
    });
})();

sushiro.calorie(search_word?: string): Promise<string>

If a string is specified as the argument, it will return the name and calorie (kcal) of the menu that partially matches the menu name currently available at "https://www.akindo-sushiro.co.jp".
If no argument is specified, it will return the names and calories (kcal) of all the menus currently available at "https://www.akindo-sushiro.co.jp".
If there is no menu that matches the argument, it will return an error.

(async () => {
    const sushiro = new Sushiro();
    console.log(await sushiro.calorie()); // No Argument
    console.log(await sushiro.calorie('サーモン')); // When "サーモン" is specified as an argument
    await sushiro.calorie('Google').catch(() => {
      console.error('There is no item with that name!'); // When the search result does not exist
    });
})();

🍵 License

MIT