
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
lighthouse-provider
Advanced tools
This module provides a way to easily define providers for menu entries to the lighthouse launcher. It depends on generators, so run node with the --harmony flag (or use io.js).
lighthouse.js:
#!/usr/bin/env node
var Lighthouse = require('lighthouse-provider');
var lighthouse = new Lighthouse();
lighthouse.attach(function *(input) {
return {
icon: '/some/path/to/icon.png',
title: 'Execute [' + input + ']',
action: input
};
});
process.stdin.pipe(lighthouse).pipe(process.stdout);
You may now use this file as a cmd file for lighthouse.
Once you created a provider instance via
var lighthouse = new Lighthouse();
You can use it as a duplex stream:
process.stdin.pipe(lighthouse).pipe(process.stdout);
This function allows you to provide a generator function for asynchronous data retrieval (will be run through co).
The identifier parameter is optional and may be used, to filter for specific handlers.
So if your input to lighthouse looks like :someId actual input, only the handlers with the identifier someId will be called. You may use :: as an identifier to filter out only those handlers without an identifier.
The handler function will be called with whatever the user types into lighthouse (minus the identifier). It should return a co yieldable (so you may use a generator function here). As a second argument, it is provided a boolean signifying if the handlers flag was supplied. Your function may then do whatever it likes with it, retrieve data from the web, a file system or simply reformat the input etc.
Once done, simply return an object of the form:
{
icon: '/some/path/to/icon.png',
title: 'Execute [' + input + ']',
action: input
}
The icon property may be omitted, but title and action are required. lighthouse-provider will then take care of escaping and formatting the output for you.
If you return anything but an object, your handler will not be output.
An array may be returned for multiple new entries.
You may want to check out the lighthouse-provider-common module, for some useful providers.
FAQs
Provide the lighthouse launcher with commands in an easy fashion.
We found that lighthouse-provider 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.