Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@scalecube/node
Advanced tools
[![Join the chat at https://gitter.im/scalecube-js/Lobby](https://badges.gitter.im/scalecube-js/Lobby.svg)](https://gitter.im/scalecube-js/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is part of scalecube-js project, see more at https://github.com/scalecube/scalecube-js
Full documentation
This package provides Scalecube's solution with default setting for working in node.
yarn add @scalecube/node
or npm i @scalecube/node
import { createMicroservice, ASYNC_MODEL_TYPES } from '@scalecube/node';
create a seed
export const MySeedAddress: 'ws://localhost:8000';
// Create a service
createMicroservice({
address : MySeedAddress
});
Create a service
// Create service definition
export const greetingServiceDefinition = {
serviceName: 'GreetingService',
methods: {
hello: {
asyncModel: ASYNC_MODEL_TYPES.REQUEST_RESPONSE,
}
},
};
// Create a service
createMicroservice({
service : [{
definition: greetingServiceDefinition,
reference: {
hello : (name) => `Hello ${name}`
},
}],
seedAddress : MySeedAddress,
address : 'ws://localhost:8001'
});
Use a service
const microservice = createMicroservice({
seedAddress : MySeedAddress,
address : 'ws://localhost:8002'
})
// With proxy
const greetingService = microservice.createProxy({
serviceDefinition: greetingServiceDefinition
});
greetingService.hello('ME').then(console.log) // Hello ME
Dependency Injection
createMicroservice({
seedAddress : MySeedAddress,
address : 'ws://localhost:8003',
services: [
{
definition: serviceB,
reference: ({ createProxy, createServiceCall }) => {
const greetingService = createProxy({serviceDefinition: greetingServiceDefinition });
return new ServiceB(greetingService);
}
}
]
})
please Read before starting to work with scalecube.
FAQs
[![Join the chat at https://gitter.im/scalecube-js/Lobby](https://badges.gitter.im/scalecube-js/Lobby.svg)](https://gitter.im/scalecube-js/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
We found that @scalecube/node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.