![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
nest-kinesis-producer
Advanced tools
Efficient Node Kinesis Producer Based on Kevin Deng's AWS Big Data Blog
An effficient Nest.js Kinesis Producer based on Kevin Deng's blog piece
$ npm install nest-kinesis-producer
Add the Kinesis Producer to your App Module imports. It will register globally.
import { AppService } from './app.service';
import { Module } from '@nestjs/common';
@Module({
imports: [KinesisProducerModule.forRoot(new Kinesis())],
providers: [AppService],
})
export class AppModule {}
import { AppService } from './app.service';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
@Module({
imports: [
KinesisProducerModule.forRootAsync({
useFactory: (cfg: ConfigService) => new Kinesis({credentials: cfg.getCreds()}),
inject: [ConfigService],
imports: [ConfigModule],
}),
),
],
providers: [AppService],
})
export class AppModule {}
import { hash } from 'crypto';
import { RetryingBatchKinesisPublisher } from "nest-kinesis-producer";
export class AppService {
constructor(private readonly kinesisPublisher: RetryingBatchKinesisPublisher){}
public async sendToKinesis(messages: string[]): Promise<void> {
const events = messages.map((x) => {
return {
PartitionKey: this.getPartitionKey(x),
Data: x
};
});
await this.kinesisPublisher.putRecords('fakeStreamName', events);
}
public getPartitionKey(mesage: string): string {
...
}
}
`launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": ["--runInBand"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"outputCapture": "std",
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"${workspaceFolder}/lib/**/*.js",
"<node_internals>/**/*.js"
]
}
]
}
Pull requests are welcome. Please remember that commits must be made using Angular conventional-changelog
Nest-Kinesis-Producer is MIT licensed.
FAQs
Efficient Node Kinesis Producer Based on Kevin Deng's AWS Big Data Blog
The npm package nest-kinesis-producer receives a total of 58 weekly downloads. As such, nest-kinesis-producer popularity was classified as not popular.
We found that nest-kinesis-producer 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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.