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

@soapjs/integr8-nestjs

v1.0.3

Published

[![npm version](https://badge.fury.io/js/@soapjs%2Fintegr8-nestjs.svg)](https://badge.fury.io/js/@soapjs%2Fintegr8-nestjs) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Downloads

6

Readme

@soapjs/integr8-nestjs

npm version License: MIT

Runtime method patching for NestJS applications. Override any service method AFTER application startup via HTTP API - perfect for integration testing with @soapjs/integr8.

Key Features

  • Runtime Override - Patch methods after app starts (no DI restart needed)
  • HTTP API - Send code as strings via REST endpoints
  • VM Sandbox - Secure code execution (no eval)
  • Auto-Discovery - Wraps all providers automatically
  • Factory Support - Replace entire providers
  • Fully Tested - 124 tests including 26 E2E

Installation

npm install @soapjs/integr8-nestjs
npm install @nestjs/core @nestjs/common @nestjs/platform-express

Quick Start

1. Enable in Your App

// app.module.ts
import { TestOverridesModule } from '@soapjs/integr8-nestjs';

const testModules = TestOverridesModule.isEnabled() 
  ? [TestOverridesModule] 
  : [];

@Module({
  imports: [...testModules, YourOtherModules],
})
export class AppModule {}

2. Set Environment

export INTEGR8_OVERRIDES_ENABLED=1
export INTEGR8_OVERRIDES_TOKEN=your-secret-token

3. Start & Override

# Start your app
npm start

# Override a method via HTTP
curl -X POST http://localhost:3000/__integr8__/override/UsersService \
  -H "Authorization: Bearer your-secret-token" \
  -H "Content-Type: application/json" \
  -d '{
    "methods": {
      "findAll": {
        "type": "fn",
        "body": "return [{ id: 999, name: \"Mocked User\" }];"
      }
    }
  }'

# Test it
curl http://localhost:3000/users
# Returns: [{"id":999,"name":"Mocked User"}]

📖 Examples

Override Single Method

POST /__integr8__/override/UsersService
{
  "methods": {
    "findOne": {
      "type": "fn",
      "args": ["id"],
      "body": "return { id, name: \"User \" + id };"
    }
  }
}

Replace Entire Provider (Factory)

POST /__integr8__/override/UsersService
{
  "factory": {
    "body": "return { findAll: () => [], findOne: (id) => null };"
  }
}

Reset Override

POST /__integr8__/override/UsersService
{ "reset": true }

# Or reset all
POST /__integr8__/override/reset-all

List Active Overrides

GET /__integr8__/overrides

🧪 Using in Tests

import axios from 'axios';

const api = axios.create({
  baseURL: 'http://localhost:3000',
  headers: { 'Authorization': 'Bearer your-secret-token' }
});

describe('Users API', () => {
  beforeEach(async () => {
    // Apply override
    await api.post('/__integr8__/override/UsersService', {
      methods: {
        findAll: {
          type: 'fn',
          body: 'return [{ id: 1, name: "Test User" }];'
        }
      }
    });
  });

  afterEach(async () => {
    // Reset
    await api.post('/__integr8__/override/reset-all');
  });

  it('returns mocked data', async () => {
    const res = await axios.get('http://localhost:3000/users');
    expect(res.data[0].name).toBe('Test User');
  });
});

Security

⚠️ Only for test environments!

Protection layers:

  • Environment gate: INTEGR8_OVERRIDES_ENABLED=1
  • Bearer token auth: INTEGR8_OVERRIDES_TOKEN
  • VM sandbox: No access to require/process
  • Execution timeout: 5000ms

Documentation

License

MIT © Radoslaw Kamysz

Related


Made with ❤️ by the SoapJS team