Socket
Socket
Sign inDemoInstall

detective-cjs

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detective-cjs - npm Package Compare versions

Comparing version 4.1.0 to 5.0.0

4

index.js
'use strict';
const types = require('ast-module-types');
const Walker = require('node-source-walk');
const types = require('ast-module-types');

@@ -14,3 +14,3 @@ /**

walker.walk(content, (node) => {
walker.walk(content, node => {
if (!types.isRequire(node) || !node.arguments || node.arguments.length === 0) {

@@ -17,0 +17,0 @@ return;

{
"name": "detective-cjs",
"version": "4.1.0",
"version": "5.0.0",
"description": "Get the dependencies of a CommonJS module by traversing its AST",

@@ -10,4 +10,4 @@ "main": "index.js",

"scripts": {
"lint": "eslint index.js \"test/*.js\"",
"fix": "npm run lint -- --fix",
"lint": "xo",
"fix": "xo --fix",
"mocha": "mocha",

@@ -37,3 +37,3 @@ "test": "npm run lint && npm run mocha",

"engines": {
"node": ">=12"
"node": ">=14"
},

@@ -46,5 +46,39 @@ "dependencies": {

"c8": "^7.13.0",
"eslint": "^8.36.0",
"mocha": "^9.2.2"
"mocha": "^9.2.2",
"xo": "^0.54.2"
},
"xo": {
"space": true,
"ignores": [
"test/fixtures/*"
],
"rules": {
"arrow-body-style": "off",
"capitalized-comments": "off",
"comma-dangle": [
"error",
"never"
],
"curly": [
"error",
"multi-line"
],
"operator-linebreak": [
"error",
"after"
],
"object-curly-spacing": [
"error",
"always"
],
"space-before-function-paren": [
"error",
"never"
],
"unicorn/prefer-module": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-top-level-await": "off",
"unicorn/prevent-abbreviations": "off"
}
}
}

@@ -1,3 +0,7 @@

### detective-cjs [![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-detective-cjs/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-detective-cjs/actions/workflows/ci.yml?query=branch%3Amain) [![npm](https://img.shields.io/npm/v/detective-cjs)](https://www.npmjs.com/package/detective-cjs) [![npm](https://img.shields.io/npm/dm/detective-cjs)](https://www.npmjs.com/package/detective-cjs)
# detective-cjs
[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-detective-cjs/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-detective-cjs/actions/workflows/ci.yml?query=branch%3Amain)
[![npm version](https://img.shields.io/npm/v/detective-cjs)](https://www.npmjs.com/package/detective-cjs)
[![npm downloads](https://img.shields.io/npm/dm/detective-cjs)](https://www.npmjs.com/package/detective-cjs)
> Get the dependencies of a CommonJS module by traversing its AST

@@ -12,3 +16,3 @@

### Usage
## Usage

@@ -27,4 +31,4 @@ ```js

#### License
## License
MIT
[MIT](LICENSE)
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