npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

restate-nest

v1.1.9

Published

A decorator based easy to use nestjs and restate.dev integration

Readme

Restate Nest

A seamless integration between Restate and NestJS, making it easier to build reliable, stateful applications with the power of durable execution.

Features

  • Declarative Service Registration: Use decorators to define Restate services, virtual objects, and workflows
  • Type-Safe: Full TypeScript support for better developer experience
  • Seamless Integration: Works alongside your existing NestJS modules and services
  • Minimal Boilerplate: Focus on business logic instead of infrastructure code

Installation

npm install restate-nest @restatedev/restate-sdk @restatedev/restate-sdk-clients

Peer Dependencies

  • @restatedev/restate-sdk-clients (>=1.6.1)
  • @restatedev/restate-sdk (>=1.6.1)
  • @nestjs/common (>=10.4.19)

Prerequisites

  • Node.js 16 or later
  • NestJS 10.x or later
  • A running Restate instance

Quick Start

  1. Import the module in your app.module.ts:
import { Module } from '@nestjs/common';
import { RestateModule } from 'restate-nest';

@Module({
  imports: [
    RestateModule.forRoot({
      url: 'http://localhost:8080', // Your Restate server URL
      listenerPort: 9080, // Optional: Port for the Restate listener
    }),
  ],
})
export class AppModule {}
  1. Create a Restate Service:
import { RestateService, RestateHandler } from 'restate-nest';

@RestateService('greeter')
export class GreeterService {
  @RestateHandler()
  async greet(ctx: restate.Context, name: string /** other args**/): Promise<string> {
    return `Hello, ${name}!`;
  }
}
  1. Register your services in the module:
@Module({
  imports: [RestateModule.forFeature({
    services: [GreeterService]
  })],
  providers: [GreeterService],
  // ... other module configuration
})
export class GreeterModule {}

Advanced Usage

Using Restate Client

For calling other Restate services, you can inject the clients.Ingress into your service.

import {RESTATE_CLIENT} from 'restate-nest';
import {Inject} from '@nestjs/common';
import * as clients from '@restatedev/restate-sdk-clients';

@Service()
export class GreeterService {
  constructor(@Inject(RESTATE_CLIENT) private readonly restateClient: clients.Ingress) {}

  async hello(name: string): Promise<string> {
	  await this.restateClient.serviceClient<{
		  greet: (name: string) => Promise<boolean>;
	  }>({ name: 'greeter' as const }).greet()
  }
}

Virtual Objects

import { RestateObject, RestateHandler } from 'restate-nest';

@RestateObject()
export class Counter {
  private count: number = 0;

  @RestateHandler()
  async increment(ctx: restate.ObjectContext, amount: number = 1): Promise<number> {
    this.count += amount;
    return this.count;
  }
}

Workflows

import { RestateWorkflow, RestateHandler } from 'restate-nest';

@RestateWorkflow('order-processing')
export class OrderWorkflow {
  @RestateHandler()
  async run(ctx: restate.WorkflowSharedContext<any>, orderId: string): Promise<void> {
    // Your workflow logic here
    // Every workflow must have a "run" method
  }
  @RestateHandler()
  async getStaus(ctx: restate.WorkflowSharedContext<any>, orderId: string): Promise<void> {
    // Your workflow logic here
    // Every workflow must have a "run" method
  }
}

Configuration

Module Options

  • url: (Required) The URL of your Restate server
  • listenerPort: (Optional) Port for the Restate listener (default: 9080)

Error Handling

All Restate-related errors will be properly propagated and can be caught using NestJS's exception filters.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. https://github.com/subenksaha/restate-nest

License

This project is licensed under the MIT License - see the LICENSE file for details.