Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
temporalio
Advanced tools
Typescript + NodeJS SDK for Temporal.
For more information see the proposal.
This project requires nodejs LTS version 12 (or later).
Furthermore, to install this module you will need a c++ compiler. If you run into errors during installation it is likely your environment is not properly set up.
The worker package embeds the Temporal Core SDK which requires the Rust toolchain to compile. We provided prebuilt binaries for the worker for:
Mac with an Intel chip: x86_64-apple-darwin
Mac with an M1 chip: aarch64-apple-darwin
Linux with x86_64 architecture: x86_64-unknown-linux-gnu
Windows with x86_64 architecture: x86_64-pc-windows-gnu
If you need to compile the worker yourself, set up the Rust toolchain by following the instructions here.
To set up a C++ compiler for node-gyp
, follow the instuctions here
npm init @temporalio ./example
cd ./example
NOTE:
init
triggers native module compilation which might take a while, npm 7 hides the compilation output so it may appear that the installation is stuck, to see the compilation progress exportNPM_CONFIG_FOREGROUND_SCRIPTS=true
.
npm run build
Download, install, and run the Temporal server via docker-compose. It is easy to do and you can keep it running in the background while you build applications.
Run the worker
node lib/worker/index.js
Run the workflow
node lib/worker/test.js
Not working yet, activities not implemented
src/activities/greeter.ts
export async function greet(name: string): Promise<string> {
return `Hello, ${name}!`;
}
src/interfaces/workflows.ts
import { Workflow } from '@temporalio/workflow';
export interface Example extends Workflow {
main(name: string): Promise<string>;
}
src/workflows/example.ts
import { Example } from '@interfaces/workflows';
import { greet } from '@activities/greeter';
async function main(name: string): Promise<string> {
return await greet(name);
}
export const workflow: Example = { main };
src/worker/index.ts
import { Worker } from '@temporalio/worker';
(async () => {
// Automatically locate and register activities and workflows
const worker = await Worker.create(__dirname);
// Bind to the `tutorial` queue and start accepting tasks
await worker.run('tutorial');
})();
src/worker/test.ts
import { Connection } from '@temporalio/client';
import { Example } from '@interfaces/workflows';
(async () => {
const connection = new Connection();
const example = connection.workflow<Example>('example', { taskQueue: 'tutorial' });
const result = await example('Temporal');
console.log(result); // Hello, Temporal
})();
See docs
git submodule init
git submodule update
npm ci
npm run build
npm run rebuild
npm run build # Must be run once before build.watch
npm run build.watch
npm run test
-- OR --
npm run test.watch
FAQs
Temporal.io SDK meta-package
We found that temporalio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.