Gathering detailed insights and metrics for @poppinss/module-methods-extractor
Gathering detailed insights and metrics for @poppinss/module-methods-extractor
Gathering detailed insights and metrics for @poppinss/module-methods-extractor
Gathering detailed insights and metrics for @poppinss/module-methods-extractor
npm install @poppinss/module-methods-extractor
Typescript
Module System
Node Version
NPM Version
70.8
Supply Chain
99.3
Quality
79.5
Maintenance
100
Vulnerability
100
License
Update underlying dependencies
Updated on Aug 31, 2020
Updating underlying dependencies
Updated on Jul 18, 2020
Adding prettier
Updated on Jul 04, 2020
Update overall project structure
Updated on Apr 12, 2020
Fixes a bug where esm exports with imports where not handled properly
Updated on Nov 13, 2019
First Release
Updated on Nov 10, 2019
TypeScript (66.22%)
HTML (29.21%)
JavaScript (4.58%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,746
Last Day
1
Last Week
3
Last Month
34
Last Year
161
MIT License
4 Stars
24 Commits
1 Forks
2 Watchers
5 Branches
3 Contributors
Updated on Dec 27, 2023
Minified
Minified + Gzipped
Latest Version
1.0.5
Package Id
@poppinss/module-methods-extractor@1.0.5
Unpacked Size
20.96 kB
Size
6.08 kB
File Count
9
NPM Version
6.14.7
Node Version
14.8.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-25%
3
Compared to previous week
Last Month
126.7%
34
Compared to previous month
Last Year
-42.9%
161
Compared to previous year
Returns a list of method names and line number for a JavaScript or TypeScript module.
This module is used by the AdonisJs VsCode extension to show an autocomplete list of controller methods, event listeners and so on.
The module is tailored for AdonisJs only, which helps in optimizing the way we scan the source code AST.
Install the package from npm registry as follows:
1import { Extractor } from '@poppinss/Extractor' 2 3const extractor = new Extractor() 4 5const response = extractor.extract(` 6export default class UserController { 7 public async index () { 8 } 9 10 public async store () { 11 } 12} 13`) 14 15assert.deepEqual(response, { 16 kind: 'class', 17 methods: [ 18 { 19 name: 'index', 20 lineno: 2 21 }, 22 { 23 name: 'store', 24 lineno: 5 25 }, 26 ] 27})
The module is written to work with AdonisJs, where modules are not imported explicitly but their filenames are passed as a reference. For example:
1Route.get('users', 'UsersController.index')
In the above example, The UsersController
is an actual module that has a default export
on the UserController
class. AdonisJs behind the scenes will use its IoC container to lazy load this class and invoke the defined method.
module.exports
and exports
are supported.export default
is supported.module.exports = exports = UserController
.export default UserController {}
.lineno
for all methods.Named exports are not allowed, since they are also forbidden by the IoC container automatic bindings.
The export reference must be located as a top level property. For example:
1const someObject = { 2 prop: class UserController {} 3} 4 5export default someObject.prop
The above expression is not something we advocate in the AdonisJs eco-system and also it is not a great pattern to use either.
Only 3 levels deep assignments are supported.
1// works 2module.exports = exports = UserController 3 4// works 5module.exports = exports = someFunc = UserController 6 7// does not work 8module.exports = exports = someFunc = someOtherFunc = UserController
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
project is archived
Details
Reason
Found 0/21 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
39 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More