Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@cua.run/babel
Advanced tools
`cua` is your favorite async tasks handler to offload your JavaScript API.
@cua.run/babel
cua
is your favorite async tasks handler to offload your JavaScript API.
@cua.run/babel
enable you to seamlessly call cua functions as follows:
import type { NextApiRequest, NextApiResponse } from "next";
import importContacts from "../../cua-functions/importContacts";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
const user = { /* ... */ }
await importContacts([user]); // will be replaced by `cua.push('importContacts', [user])` by our babel plugin
res.status(200).json({ name: "John Doe" });
}
yarn add -D @cua.run/babel
# or
npm i --save-dev @cua.run/babel
Next.js
Create a babelrc.js
configuration as follows:
const babelPlugin = require("@cua.run/babel");
module.exports = {
presets: ["next/babel"],
plugins: [[babelPlugin]],
};
cua
functionAll cua
functions must be in a root cua-functions/
folder:
example for a Next.js project:
- pages/
- _app.ts
- index.ts
- api/
- import.ts
- cua.functions/
- importContacts.ts
- .babelrc.js
- next.config.js
- package.json
Then, your cua
function should be a file having:
CuaFunction
signaturecua.functions/importContacts.ts
import { CuaFunction } from "@cua.run/client";
interface Contact {
id: string
name: string
}
const importContacts: CuaFunction = (contact: Contact[]) => {
// ...
// returns a Promise
}
export default importContacts
Then, your cua
function can be invoked as follows:
pages/api/import.ts
import type { NextApiRequest, NextApiResponse } from "next";
import importContacts from "../../cua-functions/importContacts";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
const user = { /* ... */ }
// will delay the execution of the function in the background queue
await importContacts([user]);
res.status(200).json({ ok: true });
}
FAQs
`cua` is your favorite async tasks handler to offload your JavaScript API.
The npm package @cua.run/babel receives a total of 9 weekly downloads. As such, @cua.run/babel popularity was classified as not popular.
We found that @cua.run/babel 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 a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.