Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@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 0 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.