
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
docker-file-parser
Advanced tools
Parses a dockerfile contents string and returns the array of commands, keeping the original file order.
var parser = require('docker-file-parser');
var options = { includeComments: false };
var contents = 'FROM ubuntu:latest\n'
+ 'ADD . /root\n'
+ 'RUN echo done\n';
var commands = parser.parse(contents, options);
commands.every(function (cmd) { console.log(cmd); });
includeComments
Whether to include comment commands in the returned array.
A comment will have the command name as 'COMMENT'.Each returned command entry is an object with these properties:
name
The capitalized name of the command, e.g. 'FROM'.args
Arguments for the command (can be array, string or map).lineno
Line number from the contents string.error
Only if there was an error parsing command.Example:
{
name: 'ADD',
args: [ '.', '/srv/app' ],
lineno: 5
}
There are other docker file parse modules for JavaScript, like
dockerfile-parse
and dockerfile-parser
, this module differs in the follow
aspects:
FAQs
Parses a Dockerfile and returns an array of commands.
The npm package docker-file-parser receives a total of 14,270 weekly downloads. As such, docker-file-parser popularity was classified as popular.
We found that docker-file-parser demonstrated a not healthy version release cadence and project activity because the last version was released 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.