Catalog npm
PACKAGE EXPLORERView in registry

30s

npm

A command-line application for 30 seconds of code snippets

clijavascriptsnippets
Versions collected145
Direct dependencies40From release 1.5.46
Last observed20 Oct, 19:23 UTC

README

Current package documentation

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 git@github.com:sQVe/30s.git
$ cd 30s/
$ npm install
$ node lib/index.js <command> <query>

Usage

Commands

Short versionLong versionDescription
rrandomView random snippet
ssearchFuzzy search (RegExp) snippets by id
ttagView snippets by tag
vviewView snippet with id
*View snippet with id

Options

Short versionLong versionDescription
-c--cpCopy snippet code to clipboard
-j--jsonPrint output in JSON format
-l--layoutPrint output with specified layout (default: "itced")
-h--helpOutput usage information
Layout
Layout keyDescription
iOutput snippet id
tOutput snippet tags
cOutput snippet code
eOutput snippet examples
dOutput snippet description

Examples

ExampleDescription
30s headView snippet with id head
30s v headView snippet with id head
30s view headView snippet with id head
30s rView random snippet
30s randomView random snippet
30s t arrayView snippets by tag array
30s tag arrayView snippets by tag array
30s s allFind all snippets with an id that contains all
30s search allFind all snippets with an id that contains all
30s view merge --cpView snippet with id merge and copy its code
30s view merge --jsonView snippet with id merge and output as JSON
30s search all --layout ceFind 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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 145

Collected releases
VersionPublishedDirect dependenciesOpen version
1.5.2619 Mar 202141
1.5.259 Mar 202142
1.5.249 Mar 202142
1.5.2329 Nov 202042
1.5.2227 Nov 202042
1.5.2115 Nov 202042
1.5.2014 Nov 202042
1.5.194 Nov 202042
1.5.183 Nov 202042
1.5.172 Nov 202042
1.5.1631 Oct 202042
1.5.1527 Oct 202042
1.5.1423 Oct 202042
1.5.1322 Oct 202042
1.5.1221 Oct 202042
1.5.1120 Oct 202042
1.5.1019 Oct 202042
1.5.918 Oct 202042
1.5.817 Oct 202042
1.5.716 Oct 202042

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
sqve/30s

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
sqve/30-seconds-of-code-cli

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:23 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:409f5578104ec13ff5c849f91895a268e40c422d5b9629fb002f2dce8736df28