{"name":"ast-module-types","version":"3.0.0","description":"Collection of useful helper functions when trying to determine module type (CommonJS or AMD) properties of an AST node.","main":"index.js","scripts":{"lint":"eslint index.js \"test/*.js\"","mocha":"mocha","test":"npm run lint && npm run mocha"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-ast-module-types.git"},"keywords":["esprima","module","type","define","require","factory"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com","url":"https://mrjoelkemp.com/"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-ast-module-types/issues"},"homepage":"https://github.com/dependents/node-ast-module-types","engines":{"node":">=6.0"},"devDependencies":{"eslint":"^5.16.0","mocha":"^6.2.3","node-source-walk":"^4.2.2"},"gitHead":"b74e677a81aa1bccf87b6dc65906612b85f2454a","_id":"ast-module-types@3.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ==","shasum":"9a6d8a80f438b6b8fe4995699d700297f398bf81","tarball":"http://registry-npm.ywwl.com/ast-module-types/download/ast-module-types-3.0.0.tgz","fileCount":4,"unpackedSize":10897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFMYgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpatw//eekHcjw1yqw5k3GtuSToMOPu1gwTWgpqoNssM9uMqFDGVx4i\r\nfW4Eq8HF3vmwCbTT6bYC9TJD1WA5kkd0qCRVkjOIBzQEFzsaBz+80AgxSCtw\r\n6EhFyuj9STosvnSgow7wHno/fE+AHrEPCPCYWfLtj7F9G/9Pyx9ntmqsYVdp\r\notJsSP1kErnEAAY16kfsUj63ZUU+SHSoTJp5yMTQmMPwDMnRKpX3R13D5Cib\r\nsLiwOCN0+Ev+z44pZl/HANGftZ6um+AzrpevwxzWW128B+hAQWVWnQWCxwSl\r\nPuJhzbkC+YAVjgqWUWOpy2bZ/u+A7caTmMVJnSe40kPlkaod/Ja6/Xu2uq5c\r\neRN92FWJG+4xuJO6Rq/dkhqqrHZlJGrkiHOeqY9nBnFcr4huv6tu4AJDub4V\r\n/pmFx0Ft+FZdgvsd2AEyPeScqVxfh8XBo7QmcJC7c32uA9sgRIoon+3w4k2+\r\nRAIJ67ZvhisKtiTEJiafNwtEhXy72jog4iCmKqcMcaQvEgPf0p77ilOUReJZ\r\nV6oqhEcnucLFmIEqdVbtRNkAN24eyfIU+NVBT4EqHaG2OkoD2rzr2dajOVR0\r\n3uLbJBjYDfaUVIYqrvCFXrWn3ttlDy7jLk0VPuoBu3PTdG6g4SzN+bgiN5NR\r\nRV7J1uA1pruI64ZjU7G3aHmxgmM145Cxf+Y=\r\n=VvWE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmIfyEtQ7ZQxNbs5+2iKXyGpR82lvaD+MqNvMjpm6MJAIhAJMBWmugWnMOGI6fO6KaT+yzal4IDfcIxgahu2QZrBMK"}],"size":3328,"noattachment":false,"key":"/ast-module-types/-/ast-module-types-3.0.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"mrjoelkemp","email":"mrjoelkemp@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ast-module-types_3.0.0_1645528608243_0.6584593877050993"},"_hasShrinkwrap":false,"readme":"# ast-module-types\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-ast-module-types/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-ast-module-types/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/ast-module-types?logo=npm&logoColor=fff)](https://www.npmjs.com/package/ast-module-types)\n[![npm downloads](https://img.shields.io/npm/dm/ast-module-types)](https://www.npmjs.com/package/ast-module-types)\n\nCollection of useful helper functions when trying to determine\nmodule type (CommonJS or AMD) properties of an AST node.\n\n**AST checks are based on the Esprima (Spidermonkey) format**\n\n```sh\nnpm install ast-module-types\n```\n\n## API\n\nEach of these takes in a single AST node argument\nand returns a boolean.\n\n* `isDefineAMD`: if node matches any form of an AMD `define` function call\n* `isRequire`: if node matches a `require` function all (declaring a dependency)\n* `isTopLevelRequire`: if node matches a `require` at the very top of the file.\n* `isAMDDriverScriptRequire`: if node matches an AMD driver script's require call `require([deps], function)`\n* `isExports`: if the node matches CommonJS `module.exports` or `exports` (defining a module)\n\nDetecting the various forms of defining an AMD module\n\n* `isNamedForm`: if the node is a define call of the form: `define('name', [deps], func)`\n* `isDependencyForm`: if the node is a define call of the form: `define([deps], func)`\n* `isFactoryForm`: if the node is a define call of the form: `define(func(require))`\n* `isNoDependencyForm`: if the node is a define call of the form: `define({})`\n* `isREMForm`: if the node matches the form: `define(function(require, exports, module){});`\n\nES6 Types\n\n*All types abide by the [EStree spec](https://github.com/estree/estree/blob/master/es2015.md)*\n\n* `isES6Import`: if the node is any of the es6 import forms\n* `isES6Export`: if the node is of any es6 export forms\n\n## Usage\n\n```js\nconst types = require('ast-module-types');\n\n// Assume node is some node of an AST that you parsed using esprima or esprima-fb\n// ...\n\nconsole.log(types.isDefineAMD(node));\n```\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1645528608362,"_cnpm_publish_time":1645528608362,"dist-tags":{"latest":"7.0.0"}}