{"versions":{"0.1.0":{"name":"astral-pass","version":"0.1.0","description":"Pass system for Astral","main":"pass.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/btford/astral-pass.git"},"keywords":["astral"],"author":{"name":"Brian Ford"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/btford/astral-pass/issues"},"_id":"astral-pass@0.1.0","dist":{"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/astral-pass/-/astral-pass-0.1.0.tgz","shasum":"7e7851077a21e41d98191908a258467ecd30eee8","size":1821,"noattachment":false,"integrity":"sha512-x3qydVU/UkzcrIjn6r1YMd5XrbyA9Auvmt44eQlUeW7bNHNibtYD4c14KwOoZpQhO0FpRVQ13KnQHDTPgiN6jA=="},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"anonymous","email":"briantford@gmail.com"},"maintainers":[{"name":"anonymous","email":"briantford@gmail.com"}],"directories":{},"publish_time":1370403195367,"_hasShrinkwrap":false,"_cnpm_publish_time":1370403195367,"_cnpmcore_publish_time":"2021-12-18T19:14:15.694Z","contributors":[]},"0.0.1":{"name":"astral-pass","version":"0.0.1","description":"Pass system for Astral","main":"pass.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/btford/astral-pass.git"},"keywords":["astral"],"author":{"name":"Brian Ford"},"license":"MIT","readmeFilename":"README.md","bugs":{"url":"https://github.com/btford/astral-pass/issues"},"_id":"astral-pass@0.0.1","dist":{"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/astral-pass/-/astral-pass-0.0.1.tgz","shasum":"5b43ac8fdc897ce3db58f66e7de59491cd753ffb","size":1825,"noattachment":false,"integrity":"sha512-XqjCbWZwPJkbmjedig/DWQA7Q2fS+SObdmGFEsEa84LonKIJc+4bogTzlQiatRpcpe/qqYFQ5dSMZ9B4965IxA=="},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"anonymous","email":"briantford@gmail.com"},"maintainers":[{"name":"anonymous","email":"briantford@gmail.com"}],"directories":{},"publish_time":1369465762272,"_hasShrinkwrap":false,"_cnpm_publish_time":1369465762272,"_cnpmcore_publish_time":"2021-12-18T19:14:15.949Z","contributors":[]}},"dist-tags":{"latest":"0.1.0"},"name":"astral-pass","time":{"created":"2022-01-27T00:34:36.691Z","modified":"2022-01-27T00:34:36.691Z","0.1.0":"2013-06-05T03:33:15.367Z","0.0.1":"2013-05-25T07:09:22.272Z"},"readme":"# Astral Pass\n\nPass system for [Astral](https://github.com/btford/astral-pass).\n\n## Pass Types\n\nThere are two kinds of passes: `info`, and `transform`.\n\n### Info\nInfo passes operate on a copy of the AST,\nbut are allowed to modify the `info` object passed into the function as a parameter.\n\n```javascript\nmyPass.\n  info(function (chunk, info) {\n    info.foo = 'bar'; // persists\n\n    chunk.foo = 'bar'; // does not persist\n  });\n```\n\n### Transform\nTransforms, on the other hand, allow you to modify the structure of the part of the AST that the pass matches,\nbut prevents you from making changes to the `info` parameter.\n\n```javascript\nmyPass.\n  info(function (chunk, info) {\n    info.foo = 'bar'; // does not persist\n\n    chunk.foo = 'bar'; // persists\n  });\n```\n\n## Example\n\nBelow is a simple example.\n\n```javascript\nvar myPass = require('astral-pass')();\n\nmyPass.name = 'myPass';\nmyPass.prereqs = [ /* other pass names here */ ];\n\nmyPass.\n  when({\n    // ... AST chunk\n  }).\n  when(function (chunk, info) {\n    // return true or false\n  }).\n  transform(function (chunk, info) {\n\n  });\n```\n\n## More Complicated Passes\n\nYou can introduce more complicated behavior by composing passes.\nThis is done by modifying a pass's `prereques` property.\n\n```javascript\nvar astralPass = require('astral-pass');\n\n// p1 needs some info to do its transformations\n\nvar p1 = astralPass();\np1.name = 'myPass';\np1.prereqs = [ 'p2' ];\n\np1.\n  when( ... ).\n  transform( ... );\n\n// p2 gathers the info for p1\n\nvar p2 = astralPass();\np2.name = 'myPass';\n\np2.\n  when( ... ).\n  info( ... );\n\n```\n\nI recommend namespacing passes with `:`.\n\n## License\nMIT","users":{}}