
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
get-amd-module-type
Advanced tools
Get the type of an AMD module used for an AST node or within a file
Get the type of an AMD module used for an AST node or within a file
npm install get-amd-module-type
const getType = require('get-amd-module-type');
// Async
getType('my/file.js', (error, type) => {
if (error) throw error;
console.log(type);
});
let type;
// Sync
type = getType.sync('my/file.js');
// From source code
type = getType.fromSource('define() {}');
// From an AST node
type = getType.fromAST(node);
The returned type
will be any of the following:
'named'
: define('name', [deps], func)
'deps'
: define([deps], func)
'rem'
: define(function(require, exports, module){});
'factory'
: define(function(require){})
'nodeps'
: define({})
'driver'
: require([deps], function)
FAQs
Get the type of an AMD module used for an AST node or within a file
We found that get-amd-module-type demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.