
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
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
The npm package get-amd-module-type receives a total of 2,349,443 weekly downloads. As such, get-amd-module-type popularity was classified as popular.
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 0 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.