
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
@zcatalyst/circuit
Advanced tools
ZOHO CATALYST SDK for JavaScript Circuit for Node.js and Browser.
To install this package, simply type add or install @zcatalyst/circuit using your favorite package manager:
npm install @zcatalyst/circuit
yarn add @zcatalyst/circuit
pnpm add @zcatalyst/circuit
The Catalyst SDK is modulized by Components.
To send a request, you only need to import the Circuit
:
// ES5 example
const { Circuit } = require('@zcatalyst/circuit');
// ES6+ example
import { Circuit } from '@zcatalyst/circuit';
To send a request, you:
const circuit = new Circuit();
const circuit = await circuit.execute('195000000041001', 'sampleName', { name: 'Aaron Jone'});
We recommend using await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await circuit.execute('195000000041001', 'sampleName', { name: 'Aaron Jone'});
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.
You can also use Promise chaining to execute send operation.
circuit.execute('195000000041001', 'sampleName', { name: 'Aaron Jone'})
.then(
(data) => {
// process data.
},
(error) => {
// error handling.
}
);
Promises can also be called using .catch()
and .finally()
as follows:
circuit.execute('195000000041001', 'sampleName', { name: 'Aaron Jone'})
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
We do not recommend using callbacks because of callback hell, but they are supported by the send operation.
// callbacks.
circuit.execute('195000000041001', 'sampleName', { name: 'Aaron Jone'},
(err, data) => {
// process err and data.
}
);
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await circuit.execute('195000000041001', 'sampleName', { name: 'Aaron Jone'});
// process data.
} catch (error) {
const message = error.message;
const status = error.statusCode;
console.log({ message, status });
}
Contributions to this library are always welcome and highly encouraged.
See CONTRIBUTING for more information on how to get started.
This SDK is distributed under the Apache License 2.0. See LICENSE file for more information.
FAQs
ZOHO CATALYST SDK for JavaScript Circuit for Node.js and Browser.
We found that @zcatalyst/circuit 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
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.