Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bandersnatch

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bandersnatch

[![npm](https://img.shields.io/npm/v/bandersnatch)](https://www.npmjs.com/package/bandersnatch) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hongaar/bandersnatch/ci)](https://github.com/hongaar/bandersnatch/actions?query=workf

  • 1.0.0-alpha.2
  • npm
  • Socket score

Version published
Weekly downloads
133
decreased by-76.16%
Maintainers
1
Weekly downloads
 
Created
Source

bandersnatch

npm GitHub Workflow Status npm bundle size Code Climate maintainability Code Climate coverage

Super lightweight and friendly CLI framework for Node.js.

🚧 but not quite yet

Features

  • Built-in REPL
  • Prompts for missing arguments
  • Autocompletes arguments, options and values
  • Fully typed
  • Uses the power of yargs & inquirer

It's built in TypeScript and while it's of course possible to write your app with JavaScript, you're missing out on some very handy type hints.

We don't have a generator, auto-updater and we don't make any decisions for you (apart from using inquirer for prompts). This makes bandersnatch pretty easy and intuitive to work with.

Getting started

# Add dependency
yarn add bandersnatch

Now create a simple app echo.ts:

import { program, command } from 'bandersnatch'

const echo = command('echo', 'Echo something in the terminal')
  .argument('words', 'Say some kind words', { variadic: true })
  .action(function(args) {
    console.log(args.words.join(' '))
  })

program()
  .add(echo)
  .run()

More examples in https://github.com/hongaar/bandersnatch/tree/master/examples

Development

# Clone and install
git clone git@github.com:hongaar/bandersnatch.git
cd bandersnatch
yarn

# Run an example
yarn start examples/simple.ts

API

Work in progress

Todo

  • Autocomplete in repl mode
  • Remove $0 from help when in repl mode

Inspired by Vorpal

FAQs

Package last updated on 21 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc