
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.
@prsm/arc-client
Advanced tools
[](https://www.npmjs.com/package/@prsm/arc-client)
arc-client uses @prsm/duplex
in order to communicate with a @prsm/arc-server
over TCP.
import { ArcClient } from "@prsm/arc-client";
const arc = new ArcClient({
host: "localhost",
port: 3351,
secure: false,
username: "root",
password: "toor"
});
// try to authenticate using the provided username and password
// returns true if successful, false if not
const success = await arc.auth();
await arc.query({ collection: "planets", operation: "drop" });
await arc.query({
collection: "planets",
operation: "insert",
data: {
query: [
{ name: "Mercury" },
{ name: "Venus" },
{ name: "Earth" },
{ name: "Mars" }
],
},
});
const result = await arc.query({
collection: "planets",
operation: "find",
data: {
query: { name: { $includes: "M" } },
},
});
// [
// {
// name: 'Mercury',
// _created_at: 1681253769538,
// _updated_at: 1681253769538,
// _id: 'a-lgcv332a-0cd148-c4-923c-4'
// },
// {
// name: 'Mars',
// _created_at: 1681253769539,
// _updated_at: 1681253769539,
// _id: 'a-lgcv332b-0cd14b-c7-923c-7'
// }
// ]
Use collectionWrapper(collectionName: string)
to receive a more simplified API if your collection name doesn't change over time. This provides the same API as a standard @prsm/arc
Collection
, with the one exception being that this interface is async.
const planets = arc.collectionWrapper("planets");
await planets.drop();
await planets.insert([{ name: "Mercury" }, { name: "Venus" }, { name: "Earth" }, { name: "Mars" }]);
await planets.find({ name: { $includes: "M" } });
// authentication failure, error includes reason
arc.emitter.on("autherror", (error: string) => {});
// authentication was a success
arc.emitter.on("authsuccess", () => {});
To disconnect an active session, call close
on the client:
arc.close();
After closing the connection, you can reconnect by calling connect
:
arc.connect();
// you will need to reauthenticate at this point
await arc.auth();
FAQs
[](https://www.npmjs.com/package/@prsm/arc-client)
We found that @prsm/arc-client demonstrated a healthy version release cadence and project activity because the last version was released less than 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.