
Security News
Meet the Socket Team at RSAC and BSidesSF 2025
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Clip is a port of most of the features of Express to CLI programming.
Many times we want to have complex use cases that are hard to express and routing along Express and Sugarskull seem to be an apt way of doing this. Another thing that we want to do in CLI programming often is use configuration files, flags, and parameters.
Urls are partitioned with '/' with a starting '/' at all times, they are url encoded, and accept ':param' and '*'
Request follow the req,res,next
methodology.
In the future chaining CLI requests should be easier (ie a clean + build could be done through clip by calling the corresponding urls).
req.env = process.env
req.flags = require('optimist').argv
req.config = require('nconf') + app.config(...)
req.prompt = require('prompt')
req.params = app.cli(':param') ...
res = require('winston') + require('cliff')
Determines where to find the config property for requests, uses reconf
Uses a middleware if a flag is set, uses optimist
Executes a handler if the path is matched
CLI parameter preconditions ala express
#!/usr/local/bin/node
var clip = require('../');
var app = new clip();
var version = '0.0.1';
//
// SETUP
//
// Recursively find an 'app.json' file with reconf and add it to req.config
app.config('app.json',{flags:['conf']});
// Dont print stuff to console if --silent is set
app.flag('silent',function(req,res,next){
res.remove(res.transports.Console);
next();
});
// Always print out the app info (middleware)
app.use(function(req,res,next){
res.info('App.js '+version);
next();
});
app.usage(function(req,res,next) {
res.info('commands: helloworld, info');
});
app.cli(['/hello','/helloworld'], function(req,res,next) {
res.info('hello world!');
});
var utils = require('util');
app.cli(['/info','/dump'], function(req,res,next) {
res.data(utils.inspect(req));
});
app.run();
FAQs
express meets the CLI
The npm package clip receives a total of 268 weekly downloads. As such, clip popularity was classified as not popular.
We found that clip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.