Gathering detailed insights and metrics for module-importer
Gathering detailed insights and metrics for module-importer
Gathering detailed insights and metrics for module-importer
Gathering detailed insights and metrics for module-importer
@humanwhocodes/module-importer
Universal module importer for Node.js
node-sass-magic-importer
Custom node-sass importer for selector specific imports, node importing, module importing, globbing support and importing files only once
node-sass-package-importer
Custom importer for node-sass to import packages from the `node_modules` directory
sass-module-importer
Import Sass files from NPM and Bower Modules
npm install module-importer
Typescript
Module System
NPM Version
69.7
Supply Chain
98.3
Quality
75.1
Maintenance
25
Vulnerability
100
License
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
-20%
4
Compared to previous month
Last year
-91.9%
90
Compared to previous year
1
The module-importer is a fully featured tool for bulk loading modules. It provides support for loading modules locally (peer loading), including any other directory on the filesystem, filtering, and direct loading of individual modules.
The module-importer loads all specified modules into an object that has a collection of keys (keys are the filenames converted to camelcase) and the contents of each module. In addition each imports
object has a property imports._loadedModules
that contains more detailed information on every module loaded.
npm install module-importer
This package has some built-in tests to verify functionality. Tests use Mocha and Chai.
npm install --dev
npm test
To make full use of the module-importer you can pass an options object upon instantiation.
1var imports = new Importer({ 2 //opts 3});
boolean
Flag for including peer modulesfunction|regex|string
Filters out modules based on relative path to executing scriptArray[objects]
Array of option objects that specifies where else to look for modulesstring
Path of the file or folder to include. Can be relative or absolute.boolean
Indicates if the path should be loaded directly as a single module(see above)
string
Spoofs location path of executing scriptstring
Spoofs file name of executing scriptDetailed information on what modules were loaded and where they were loaded from is located in the _loadedModules
property on imports
1if(!imports.error){ 2 console.log(imports._loadedModules) 3}
1var Importer = require('module-import'); 2 3//load all local (peer) modules 4var imports = new Importer(); 5 6if(!imports.error){ 7 //do something with loaded modules 8}else{ 9 //handle error 10}
1 2//load all local (peer) modules 3var imports = new Importer({ 4 //only load models in current directory 5 filter: /model/g 6}); 7
1//loads only non-peer modules 2var imports = new Importer({ 3 includeLocal: false, 4 includes:[{ 5 //load all controllers 6 //that dont't start with dev 7 path:'../controllers', 8 filter: function(path){ 9 if(path.indexOf('dev') !== 0) return true; 10 } 11 },{ 12 //also load the authentication module 13 path:'../lib/authentication', 14 direct:true 15 }] 16});
TODO: Document Common Usage With Express
Copyright (c) 2015, Alexander Wolden
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
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
Score
Last Scanned on 2024-12-23
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