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

30s

v1.5.46

Published

A command-line application for 30 seconds of code snippets

Downloads

461

Readme

30s

A command-line application for 30 seconds of code snippets.

NPM build status codecov dependabot status semantic-release license

Demo

Features

  • Written in JavaScript (ES6)
  • View, view by tag and search snippets
  • Show what you find necessary by picking a layout
  • Colorful output or JSON
  • Copy all code to clipboard
  • Automatically updates with new snippet changes
  • Works on Linux, Mac and Windows

Installation

Pick one of the following options to install the command-line application:

Option 1: NPM / Yarn

npm install -g 30s
yarn add -g 30s

Option 2: Source

$ git clone [email protected]:sQVe/30s.git
$ cd 30s/
$ npm install
$ node lib/index.js <command> <query>

Usage

Commands

| Short version | Long version | Description | | :-----------: | :----------: | ------------------------------------ | | r | random | View random snippet | | s | search | Fuzzy search (RegExp) snippets by id | | t | tag | View snippets by tag | | v | view | View snippet with id | | * | | View snippet with id |

Options

| Short version | Long version | Description | | :-----------: | :----------: | ---------------------------------------------------------------- | | -c | --cp | Copy snippet code to clipboard | | -j | --json | Print output in JSON format | | -l | --layout | Print output with specified layout (default: "itced") | | -h | --help | Output usage information |

Layout

| Layout key | Description | | :--------: | -------------------------- | | i | Output snippet id | | t | Output snippet tags | | c | Output snippet code | | e | Output snippet examples | | d | Output snippet description |

Examples

| Example | Description | | :--------------------------- | ---------------------------------------------------------------------------- | | 30s head | View snippet with id head | | 30s v head | View snippet with id head | | 30s view head | View snippet with id head | | 30s r | View random snippet | | 30s random | View random snippet | | 30s t array | View snippets by tag array | | 30s tag array | View snippets by tag array | | 30s s all | Find all snippets with an id that contains all | | 30s search all | Find all snippets with an id that contains all | | 30s view merge --cp | View snippet with id merge and copy its code | | 30s view merge --json | View snippet with id merge and output as JSON | | 30s search all --layout ce | Find all snippets with an id that contains all and output code and example |

Contributing

Bug reports & feature requests

Please use the issue tracker to report bugs or file feature requests.

Developing

Pull requests are more than welcome. Do the following to start helping out:

  1. Fork this repository to your own GitHub account and then clone it to your local device.
  2. Run npm install in the created directory to install all necessary dependencies.

Optional steps:

  1. Uninstall 30s if it's already installed: npm uninstall -g 30s
  2. Link it to the global module directory: npm link

Style guide & conventions

Try to follow functional programming best practices. Use pure functions and Ramda when possible.

Write commits following: Angular Commit Message Conventions. This enables us to automatically release new versions together with semantic-release on fix and feat commit types.

prettier and eslint-config-sqve (a config based on standardjs) enforces our styling and formatting. It runs automatically on pre-commit and is also checked for issues on Travis CI.

Roadmap

See the development board for a detailed development roadmap. Below are a short outline of important improvements:

  • Autocomplete with omelette
  • Replace commander with basic yargs and own logic

Thanks

A big thank you to the core team and all the contributers at 30-seconds-of-code for creating an awesome curated collection of snippets.

License

Creative Commons License
CC0 1.0 Universal