Catalog npm
Back to packageRELEASE DETAILS

1.5.39

npm

30s

A command-line application for 30 seconds of code snippets

clijavascriptsnippets
Published27 Aug 2021
Direct dependencies41
Transitive dependenciesNot calculated

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.

Declared dependencies 41

Native requirements
41 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@babel/runtime
Environment
{
  "local_name": "@babel/runtime",
  "alias": false,
  "peer_metadata": null
}
~7.13.0runtime
chalk
Environment
{
  "local_name": "chalk",
  "alias": false,
  "peer_metadata": null
}
~4.1.0runtime
cli-highlight
Environment
{
  "local_name": "cli-highlight",
  "alias": false,
  "peer_metadata": null
}
~2.1.0runtime
clipboardy
Environment
{
  "local_name": "clipboardy",
  "alias": false,
  "peer_metadata": null
}
~2.3.0runtime
commander
Environment
{
  "local_name": "commander",
  "alias": false,
  "peer_metadata": null
}
~7.1.0runtime
core-js
Environment
{
  "local_name": "core-js",
  "alias": false,
  "peer_metadata": null
}
~3.9.0runtime
marked
Environment
{
  "local_name": "marked",
  "alias": false,
  "peer_metadata": null
}
~2.0.0runtime
marked-terminal
Environment
{
  "local_name": "marked-terminal",
  "alias": false,
  "peer_metadata": null
}
~4.1.0runtime
ramda
Environment
{
  "local_name": "ramda",
  "alias": false,
  "peer_metadata": null
}
~0.27.0runtime
@babel/cli
Environment
{
  "local_name": "@babel/cli",
  "alias": false,
  "peer_metadata": null
}
^7.12.0development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.12.0development
@babel/plugin-transform-runtime
Environment
{
  "local_name": "@babel/plugin-transform-runtime",
  "alias": false,
  "peer_metadata": null
}
^7.12.0development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.12.0development
@rollup/plugin-commonjs
Environment
{
  "local_name": "@rollup/plugin-commonjs",
  "alias": false,
  "peer_metadata": null
}
^17.0.0development
@rollup/plugin-json
Environment
{
  "local_name": "@rollup/plugin-json",
  "alias": false,
  "peer_metadata": null
}
^4.1.0development
@rollup/plugin-node-resolve
Environment
{
  "local_name": "@rollup/plugin-node-resolve",
  "alias": false,
  "peer_metadata": null
}
^11.0.0development
@semantic-release/changelog
Environment
{
  "local_name": "@semantic-release/changelog",
  "alias": false,
  "peer_metadata": null
}
^5.0.0development
@semantic-release/git
Environment
{
  "local_name": "@semantic-release/git",
  "alias": false,
  "peer_metadata": null
}
^9.0.0development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^26.0.0development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^14.0.0development
@types/ramda
Environment
{
  "local_name": "@types/ramda",
  "alias": false,
  "peer_metadata": null
}
^0.27.0development
babel-core
Environment
{
  "local_name": "babel-core",
  "alias": false,
  "peer_metadata": null
}
7.0.0-bridge.0development
babel-eslint
Environment
{
  "local_name": "babel-eslint",
  "alias": false,
  "peer_metadata": null
}
^10.1.0development
babel-jest
Environment
{
  "local_name": "babel-jest",
  "alias": false,
  "peer_metadata": null
}
^26.3.0development
babel-plugin-ramda
Environment
{
  "local_name": "babel-plugin-ramda",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
codecov
Environment
{
  "local_name": "codecov",
  "alias": false,
  "peer_metadata": null
}
^3.7.0development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^7.8.0development
eslint-config-sqve
Environment
{
  "local_name": "eslint-config-sqve",
  "alias": false,
  "peer_metadata": null
}
^2.15.0development
eslint-plugin-fp
Environment
{
  "local_name": "eslint-plugin-fp",
  "alias": false,
  "peer_metadata": null
}
^2.3.0development
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.20.0development
eslint-plugin-node
Environment
{
  "local_name": "eslint-plugin-node",
  "alias": false,
  "peer_metadata": null
}
^11.0.0development
eslint-plugin-promise
Environment
{
  "local_name": "eslint-plugin-promise",
  "alias": false,
  "peer_metadata": null
}
^4.2.0development
eslint-plugin-react
Environment
{
  "local_name": "eslint-plugin-react",
  "alias": false,
  "peer_metadata": null
}
^7.18.0development
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^5.1.0development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^26.4.0development
lint-staged
Environment
{
  "local_name": "lint-staged",
  "alias": false,
  "peer_metadata": null
}
^10.3.0development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.1.0development
rollup
Environment
{
  "local_name": "rollup",
  "alias": false,
  "peer_metadata": null
}
^2.26.0development
rollup-plugin-add-shebang
Environment
{
  "local_name": "rollup-plugin-add-shebang",
  "alias": false,
  "peer_metadata": null
}
^0.3.0development
rollup-plugin-babel
Environment
{
  "local_name": "rollup-plugin-babel",
  "alias": false,
  "peer_metadata": null
}
^4.4.0development
semantic-release
Environment
{
  "local_name": "semantic-release",
  "alias": false,
  "peer_metadata": null
}
^17.1.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-DIZCnBdXYxLuQyt156VJDSJxTIrnTEbnfBV+QQfEjjVTIdJIFMpFlzI3DNXHIIhjMvN8eBl+dpDt77an0ZY+EA==",
  "shasum": "19e14ef10b60930722d7f548eb7b0a959b488a16",
  "tarball": "https://registry.npmjs.org/30s/-/30s-1.5.39.tgz",
  "fileCount": 6,
  "unpackedSize": 441135,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKDBuCRA9TVsSAnZWagAAWaQQAJgcBQRux10M/lJIYOuS\nOcjBN3yacTtgIQlX0b1GJFTxdkJrtj37OhcBGsDUdFSIGNsKKT+XOWIG6vjo\njrs+nH3Yy5sjXM5//OBH+02Y5+n7zqMxrdIEE48A4Hl/A3lXwbs/Slv5Axpr\nYXcIT9ILXTzveEUIQuZFo/k5vgPzmiBGTTRv6n2mee61T38xZAFcWdIvN/37\nQ5ncirz0d9zNZsEEajVx/ZqW5TnJm3kjG9/lSB6kcAWunwROOLyyZizx7Hsr\nzGb8xdlCeOWWjtEV1+A8wXKl2iTrNHZ9zGYV4DoDixtsgQfYQ0awSZzt9MXn\nQ33sM95JofalJ2WhZBFroLOUlWLRNIUjFPxchwLTTuIgbXN+gYN0m1fLZdYo\n+uNKUTdlzyg7yFck7keUW4FRiRfkbopNLq0yNXsmdjDH+qnxaSUfCFu3vy9d\nbvGEiHolXZaMGhASXsLyZAfk/qTeeZ9+H5zoVx6SJ3OhA7AT6BwSHz/ewZre\n33rqqEl3UI1GL8en5NePCXbo4ALm2vAobhntaaCfVwx5z01W1f8wMBA1l2S+\nFE8wgVb0AOnbkPsudURoGmsYyHp/nnbWyh46Rig/MthX75ofHONDY6+ovdNF\nJLZSrg3iBC9RyeZ+AFV8mK4fxLv4PC53u1J9R3k7lThahhDYq0M9cNrG22dC\nkVvQ\r\n=bvSU\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCLa1VBog9/9YmwbjmtqKUjXtECoQlCNx9l1mW/7u8hPgIhAO1M+hS9xZOuBHzEK9IWAelfhM/bhvnHdB5NaGKvdqqz"
    }
  ]
}

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_version:e9be5bc4254eb3c0b84c09b4504a2bf92dae2232dfd189e8b620993d581896cf

Other collected versions

1.5.4616 Nov1.5.454 Nov1.5.4414 Oct1.5.4312 Oct1.5.4228 Sept1.5.4124 SeptView all collected versions →