
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
This code implements a streaming parser/serializer for ascii PPM formatted images in JavaScript. The PPM file format is very simple and human readable, so it can be useful when debugging graphics applications. The downside though is that PPM is not a very efficient format, and so it is not really suitable for long term archival or transmission of images. For those applications, you should use a standard network image format like PNG or JPEG, depending on your requirements.
To install, first you do:
npm install ppm
And here is how you can use it to write/read back an image:
var ppm = require("ppm");
var image = [
[[255, 0, 0], [255, 0, 0], [255, 0, 0]],
[[0, 255, 0], [0, 255, 0], [0, 255, 0]],
[[0, 0, 255], [0, 0, 255], [0, 0, 255]]
];
ppm.parse(ppm.serialize(image), function(err, img) {
console.log(err, img);
});
The API is streaming, and should be compatible with all the stand node.js features from fs/net/etc..
ppm.parse(stream, cb(err, result))
Parses an ASCII ppm file from the stream. When finished, calls result with the error/result of parsing the file.
ppm.serialize(image)
Converts an image into an ASCII ppm stream
(c) 2013 Mikola Lysenko. BSD
FAQs
A simple streaming ascii PPM image parser/writer
The npm package ppm receives a total of 1,487 weekly downloads. As such, ppm popularity was classified as popular.
We found that ppm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.