detective-cjs
Advanced tools
Comparing version 4.1.0 to 5.0.0
'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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5152
33