
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@hai.dinh/service-registry
Advanced tools
A client-side service discovery for microservice using etcd.
The easiest way to install service-registry is using NPM. If you have Node.js installed, it is most likely that you have NPM installed as well.
$ npm install @hai.dinh/service-registry
register(opts: Service): Service
.register() create a new service in service catalog
import ServiceRegistryFactory from @hai.dinh/service-registry
const registry = ServiceRegistryFactory.create({
driver: 'etcd',
hosts: '127.0.0.1:2379',
env: 'dev'
})
const response = await registry.register({
id: 'storage-service',
name: 'storage service',
endpoint: 'http://storage-service:3001',
category: 'core',
version: '0.0.1'
})
Parameter
Return Service
unregister(id: string): boolean
.unregister() delete the specified service in service catalog
import ServiceRegistryFactory from @hai.dinh/service-registry
const registry = ServiceRegistryFactory.create({
driver: 'etcd',
hosts: '127.0.0.1:2379',
env: 'dev'
})
const isDeleted = await registry.unregister('storage-service');
Parameter
Return boolean
get(id: string): Service
.get() to retrieve the specified service in service catalog
import ServiceRegistryFactory from @hai.dinh/service-registry
const registry = ServiceRegistryFactory.create({
driver: 'etcd',
hosts: '127.0.0.1:2379',
env: 'dev'
})
const storageService = await registry.get('storage-service')
Parameter
Return Service
list(): []Service
.list() to retrieve service catalog
import ServiceRegistryFactory from @hai.dinh/service-registry
const registry = ServiceRegistryFactory.create({
driver: 'etcd',
hosts: '127.0.0.1:2379',
env: 'dev'
})
const services = await registry.list()
Return []Service
| Property | Description |
|---|---|
| id | This is id of service, which is handled as identification for register, get or unregister service. Type: string |
| name | This is name of service, which should be readable. For e.g: "storage service". Type: string |
| category | The category of service. For e.g: "security", "logging", "storage". Type: string |
| endpoint | The endpoint of service for other services can consume. For e.g: "http://storage-service:3000". Type: string |
| version | The current version of service, which should be meet semver. For e.g: "1.0.0". Type: string |
FAQs
client-side service discovery for microservice
We found that @hai.dinh/service-registry 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
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.