Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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 3,980 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.