
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
filament-sdk
Advanced tools
Filament specific SDK middlewares for node/electron/cordova
npm install filament-sdk
import {Mesh, SerialHost, BleCentral, BaseUtil, ParserMiddleware, OPCServer} from 'filament-sdk';
var app = new Mesh(() => {
console.log("THC has been initialized");
});
app.use(new SerialHost({ baudrate : 9600 }));
app.use(new BaseUtil());
app.use(new ParserMiddleware());
app.use(new OPCServer({port : 9876}));
app.on('discover', (event) => {
// you are aware of, but not yet connected, to a device
console.log(event.id) // short hashname
console.log(event.handle) // the transport specific connection metadata
console.log(event.type) // BLECentral / SerialHost
app.connect(event)
.catch(e => console.log(e));
})
app.on('link', (link) => {
// the link has been extended by the methods in base utils
link.eval({
script : "led.green()",
environment : "tap"
memSafe : true
}, function onProgress({stage, details, percent}){
console.log(`got progress event, ${percent}% completed`);
})
.then(() => {
console.log("the LED is green!");
})
.catch(e => {
console.log("there was an error!", e);
})
})
//start things up
app.start(true);
Transports and Integrations are pretty much set and forget, as seen above. Utils export a list of methods that get attached to all new links. It is likely that you will need to use several of them to complete more intricate app specific flows.
All util methods MUST conform to the following signature
var promise = link.method(options, onProgress);
assert(promise instanceOf Promise);
// example
link.dfu({
firmware_file : "patchos",
firmware_dir : process.cwd()
}, ({percent, stage, details}) => {
console.log(`DFU ${percent}%`);
}).then(() => {
console.log("DFU COMPLETE")
// return link.someOtherMethod....
}).catch(() => {
console.log("DFU ERROR")
})
Note
some of the options available (compass, more specifically) are options available for parent classes of the plugin, it is safe to ignore them; just make note of the ones that are pertinant to what you're trying to accomplish.
Some cordova plugins are necessary to... do anything. ble-central, device, network information...
cordova plugin add cordova-plugin-ble-central
cordova plugin add cordova-plugin-device
FAQs
Filament specific SDK middlewares for node/electron/cordova
We found that filament-sdk 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.