Socket
Socket
Sign inDemoInstall

bandersnatch

Package Overview
Dependencies
59
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
1.2K
decreased by-8.43%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 21 Dec 2019

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc