New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

require-one-of

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-one-of - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="1.0.7"></a>
## [1.0.7](https://github.com/Kikobeats/require-one-of/compare/v1.0.6...v1.0.7) (2019-03-29)
### Bug Fixes
* support npx relative packages ([6dc47dd](https://github.com/Kikobeats/require-one-of/commit/6dc47dd))
<a name="1.0.6"></a>

@@ -7,0 +17,0 @@ ## [1.0.6](https://github.com/Kikobeats/require-one-of/compare/v1.0.5...v1.0.6) (2019-03-08)

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://documentup.com/Kikobeats/require-one-of",
"version": "1.0.6",
"version": "1.0.7",
"main": "src/index.js",

@@ -8,0 +8,0 @@ "author": {

'use strict'
const humanizeList = require('humanize-list')
const resolveFrom = require('resolve-from')
const humanizeList = require('humanize-list')
const assert = require('assert')
const path = require('path')

@@ -16,5 +17,17 @@ const cache = {}

const relativeNodeModulesPath = path.resolve(__dirname, '..', '..')
/**
* Normally, you are going to get node_modules from the current
* execution path.
*
* This is not applied when you are running it using `npx`
* In that case, node_modules is relative to the dependency itself.
*/
const resolveModule = module =>
resolveFrom.silent(process.cwd(), module) || resolveFrom.silent(relativeNodeModulesPath, module)
const find = (modules, error = createError) => {
for (const module of modules) {
const modulePath = resolveFrom.silent(process.cwd(), module)
const modulePath = resolveModule(module)
if (modulePath) return require(modulePath)

@@ -21,0 +34,0 @@ }

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