
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
flow-launcher-helper
Advanced tools
A simple library to help build plugins for Flow Launcher with Javascript or Typescript
npm install flow-launcher-helper
I recommend you read the Flow docs before writing your plugin. This example is based on their example.
import { Flow } from 'flow-launcher-helper';
const { on, showResult, run } = new Flow();
on('query', (params) => {
showResult({
title: 'Hello World',
subtitle: `Showing your query parameters: ${params}. Click to open Flow's website`,
method: 'do_something_for_query',
params: ['https://github.com/Flow-Launcher/Flow.Launcher'],
iconPath: 'Images\\app.png',
});
});
on('do_something_for_query', () => {
const url = params;
open(url);
});
run();
Flow
defaultIconPath
— string (optional)
: the default icon path that will be sent to Flow, so you don't need to specify everytime in the showResult
function.method
— string
: current method.requestParams
- FlowParameters
: array of parameters sent from Flow.settings
— object
: plugin settings.on
— (params: T extends FlowParameters) => void
: receives a method (string) and a callback function that will be executed when the method matches the current method.showResult
— (...results: JSONRPCResponse<TMethods>[]) => void
: receives an array of results, where you specify the title, subtitle, method, params and icon path, and logs the data to be displayed in Flow.run
— function
: runs the current method. You should call this function at the end of your script, or after all the on
functions have been called.params
— string
: current parameters.If you're writing a plugin in Typescript, you can add types to method
and settings
.
type Methods = 'my_method' | 'my_other_method'
interface Settings {
username: string;
api_token: string;
}
const { method, settings } = new Flow<Methods, Settings>()
console.log(method === 'my_method') // ✅ true
console.log(method === 'another_method') // ❌ false
console.log(settings.username) // ✅
console.log(settings.name) // ❌ Property 'name' does not exist on type 'Settings'
2.2.0
on('method', (params) => ...)
). You can also add types to the params in the on
method (on('method', (params: string) => ...)
). Note that you can't pass interfaces in this case, just types.requestParams
that returns the array of parameters of the current method. The method params
is now deprecated, as it would return just the first parameter as a string. However, it is highly recommended to get the current params via the params
argument in the callback function, as mentioned above.FAQs
A simple lib to help build plugins for Flow Launcher
The npm package flow-launcher-helper receives a total of 4 weekly downloads. As such, flow-launcher-helper popularity was classified as not popular.
We found that flow-launcher-helper 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.