Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-fixturer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-fixturer - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

6

lib/index.d.ts
/// <reference types="express" />
import { Request, Response, NextFunction } from 'express';
export interface Parameters {
saveRoutes: boolean | string[];
fixtureRoutes: boolean | string[];
saveRoutes?: boolean | string[];
fixtureRoutes?: boolean | string[];
fixtureBasePath: string;
hashFn: (req: Request) => object;
hashFn?: (req: Request) => object;
}
declare const middlewareFactory: (opts: Parameters) => (req: Request, res: Response, next: NextFunction) => void;
export default middlewareFactory;
{
"name": "express-fixturer",
"version": "0.0.1",
"version": "0.0.2",
"description": "Easily manage your API fixtures",

@@ -36,2 +36,2 @@ "main": "lib/index.js",

}
}
}

@@ -9,2 +9,14 @@ # Express-fixturer

## How to get started
Install the middleware:
```
npm install express-fixturer
```
Plug it to express:
```js
const app = express();
app.use(expressFixturer({ fixtureBasePath: './fixtures' }));
```
## API

@@ -11,0 +23,0 @@

@@ -10,6 +10,6 @@ import { Request, Response, NextFunction } from 'express';

// save all routes, yes no or define the routes you want to save
saveRoutes: boolean | string[];
fixtureRoutes: boolean | string[];
saveRoutes?: boolean | string[];
fixtureRoutes?: boolean | string[];
fixtureBasePath: string;
hashFn: (req: Request) => object;
hashFn?: (req: Request) => object;
}

@@ -35,3 +35,3 @@

params.fixtureBasePath,
`${createHash(params.hashFn(req))}.json`
`${createHash(params.hashFn!(req))}.json`
);

@@ -38,0 +38,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc