Socket
Socket
Sign inDemoInstall

liftoff

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liftoff

Launch your command line tool with ease.


Version published
Maintainers
1
Created

What is liftoff?

Liftoff is a lightweight CLI framework that helps you build command-line tools. It provides a way to bootstrap your CLI application with support for configuration files, environment variables, and plugins.

What are liftoff's main functionalities?

Command-line Interface Bootstrapping

This feature allows you to bootstrap a CLI application with Liftoff. The code sample demonstrates how to create a new Liftoff instance and launch it, printing the environment information.

const Liftoff = require('liftoff');
const MyApp = new Liftoff({
  name: 'myapp',
  moduleName: 'myapp',
  configName: 'myappfile',
  extensions: {
    '.js': null
  }
});
MyApp.launch({}, (env) => {
  console.log('MyApp is running!');
  console.log('Environment:', env);
});

Configuration File Support

Liftoff supports loading configuration files. The code sample shows how to load a configuration file if it exists and print its contents.

const Liftoff = require('liftoff');
const MyApp = new Liftoff({
  name: 'myapp',
  configName: 'myappfile',
  extensions: {
    '.js': null
  }
});
MyApp.launch({}, (env) => {
  if (env.configPath) {
    const config = require(env.configPath);
    console.log('Loaded config:', config);
  } else {
    console.log('No config file found.');
  }
});

Environment Variable Support

Liftoff can access and utilize environment variables. The code sample demonstrates how to print all environment variables when the CLI application is launched.

const Liftoff = require('liftoff');
const MyApp = new Liftoff({
  name: 'myapp',
  configName: 'myappfile',
  extensions: {
    '.js': null
  }
});
MyApp.launch({}, (env) => {
  console.log('Environment Variables:', process.env);
});

Other packages similar to liftoff

Keywords

FAQs

Package last updated on 28 Mar 2014

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