npm-registry-mock
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -0,1 +1,3 @@ | ||
var path = require('path') | ||
var hock = require("hock") | ||
@@ -22,3 +24,3 @@ var predefinedMocks = require("./lib/predefines.js").predefinedMocks | ||
if (isTarball) { | ||
var target = __dirname + "/fixtures/" + route; | ||
var target = __dirname + path.sep + "fixtures" + route.replace(/\//g, path.sep); | ||
if (customTarget && typeof customTarget == 'string') | ||
@@ -30,3 +32,3 @@ target = customTarget | ||
if (!customTarget) { | ||
var res = require("./fixtures/" + route) | ||
var res = require(__dirname + path.sep + "fixtures" + route.replace(/\//g, path.sep)) | ||
res = JSON.stringify(res).replace(/http:\/\/registry\.npmjs\.org/ig, 'http://localhost:' + port) | ||
@@ -33,0 +35,0 @@ } |
@@ -7,4 +7,11 @@ var predefinedMocks = exports.predefinedMocks = { | ||
"/underscore/-/underscore-1.3.1.tgz": [200], | ||
"/underscore/-/underscore-1.5.1.tgz": [200] | ||
"/underscore/-/underscore-1.5.1.tgz": [200], | ||
"/request": [200], | ||
"/request/latest": [200], | ||
"/request/0.9.0": [200], | ||
"/request/-/request-0.9.0.tgz": [200], | ||
"/request/-/request-0.9.5.tgz": [200], | ||
"/request/-/request-2.27.0.tgz": [200], | ||
} | ||
} |
{ | ||
"name": "npm-registry-mock", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "mock the npm registry", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,4 +9,9 @@ [![Build Status](https://travis-ci.org/robertkowalski/npm-registry-mock.png?branch=master)](https://travis-ci.org/robertkowalski/npm-registry-mock) | ||
Currently mocked packages are `underscore` at 1.3.1 and 1.5.1 while version 1.5.1 is the latest in this mocked registry. | ||
Currently mocked packages are: | ||
`underscore` at 1.3.1 and 1.5.1 while version 1.5.1 is the latest in this mocked registry. | ||
`request` at 0.9.0, 0.9.5 and 2.27.0 while version 2.27.0 is the latest in this mocked registry. | ||
Installing underscore 1.3.1: | ||
@@ -13,0 +18,0 @@ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
686079
22
166
56