{"name":"dockerfile-ast","description":"Parse a Dockerfile into an array of instructions and comments.","keywords":["ast","abstract","docker","dockerfile","moby","parse","parser","syntax","tree"],"version":"0.7.1","author":{"name":"Remy Suen"},"license":"MIT","bugs":{"url":"https://github.com/rcjsuen/dockerfile-ast/"},"repository":{"type":"git","url":"git+https://github.com/rcjsuen/dockerfile-ast.git"},"engines":{"node":"*"},"main":"lib/main.js","typings":"./lib/main","dependencies":{"vscode-languageserver-textdocument":"^1.0.8","vscode-languageserver-types":"^3.17.3"},"devDependencies":{"@types/mocha":"^10.0.10","@types/node":"^6.0.52","mocha":"^11.1.0","nyc":"^17.1.0","typescript":"^5.2.2"},"scripts":{"build":"tsc -p .","prepublish":"tsc -p ./src","watch":"tsc --watch -p .","test":"mocha out/test out/test/instructions","nyc":"nyc mocha out/test out/test/instructions","nyc-ci":"nyc --reporter=lcov mocha out/test out/test/instructions"},"_id":"dockerfile-ast@0.7.1","gitHead":"ad7fbc005d55a67e7250b75dee826e1040d3f724","homepage":"https://github.com/rcjsuen/dockerfile-ast#readme","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-oX/A4I0EhSkGqrFv0YuvPkBUSYp1XiY8O8zAKc8Djglx8ocz+JfOr8gP0ryRMC2myqvDLagmnZaU9ot1vG2ijw==","shasum":"16f2be0434bfc940c9eaf00da97099fe5d2c050f","tarball":"http://registry-npm.ywwl.com/dockerfile-ast/download/dockerfile-ast-0.7.1.tgz","fileCount":74,"unpackedSize":239390,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHjBesREICqV3GjuDvkWjJ7nMciMuUNxmomAxpOZnYBZAiA4yqGlQg7R4ktRwu/iSRustdjOh3/ETqoQSEpiRy1K+A=="}],"size":39054,"noattachment":false,"key":"/dockerfile-ast/-/dockerfile-ast-0.7.1.tgz"},"_npmUser":{"name":"rcjsuen","email":"remy.suen@gmail.com"},"directories":{},"maintainers":[{"name":"rcjsuen","email":"remy.suen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dockerfile-ast_0.7.1_1753105500777_0.9849033536485647"},"_hasShrinkwrap":false,"readme":"# Dockerfile AST\n\n![Node.js Builds](https://github.com/rcjsuen/dockerfile-ast/workflows/Node.js%20Builds/badge.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/rcjsuen/dockerfile-ast/badge.svg?branch=master)](https://coveralls.io/github/rcjsuen/dockerfile-ast?branch=master) [![Build Dependencies](https://david-dm.org/rcjsuen/dockerfile-ast.svg)](https://david-dm.org/rcjsuen/dockerfile-ast) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm downloads per week](https://img.shields.io/npm/dw/dockerfile-ast.svg)](https://www.npmjs.com/package/dockerfile-ast)\n\nThe `dockerfile-ast` NPM module is a Dockerfile parser written in TypeScript.\nThe module provides full programmatic access to a parsed Dockerfile.\n\nSupported features:\n- escaped newline detection\n  - `escape` parser directive considered when parsing\n- comments preserved\n  - inlined comments in multiline instructions preserved\n- continuous empty newlines honoured (albeit discouraged as of Docker CE 17.09)\n- `ARG` and `ENV` variable lookup and resolution\n\nUnsupported:\n- `\\r` as a a line delimiter\n  - only `\\r\\n` and `\\n` are supported as being line delimiters\n  - if a `\\r` is detected the parser assumes that it is followed by a `\\n`\n\n## Development Instructions\n\nIf you wish to build and compile this project, you must first install [Node.js](https://nodejs.org/en/download/) if you have not already done so.\nAfter you have installed Node.js and cloned the repository with Git, you may now proceed to build and compile the project with the following commands:\n\n```\nnpm install\nnpm run build\nnpm test\n```\n\nIf you are planning to change the code, use `npm run watch` to get the\nTypeScript files transpiled on-the-fly as they are modified.\n\n## Installation Instructions\n\nTo add this library as a dependency to your project, please add `dockerfile-ast` as a dependency in your package.json file.\n\n## Using this Module\n\n```TypeScript\nimport { DockerfileParser } from 'dockerfile-ast';\n\nconst content =\n`FROM alpine\nExposE 8080`\n\nlet dockerfile = DockerfileParser.parse(content);\nlet instructions = dockerfile.getInstructions();\nfor (let instruction of instructions) {\n  // FROM\n  // EXPOSE\n  console.log(instruction.getKeyword());\n  // FROM\n  // ExposE\n  console.log(instruction.getInstruction());\n}\n```\n","publish_time":1753105500972,"_cnpm_publish_time":1753105500972,"dist-tags":{"latest":"0.7.1"}}