Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-png

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-png - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

10

index.js
'use strict';
const PNG = require('pngjs').PNG;
const {PNG} = require('pngjs');
module.exports = (buf, opts) => {
if (!Buffer.isBuffer(buf)) {
return Promise.reject(new TypeError('Expected a buffer'));
module.exports = async (buffer, opts) => {
if (!Buffer.isBuffer(buffer)) {
throw new TypeError(`Expected \`buffer\` to be of type \`Buffer\` but received type \`${typeof buffer}\``);
}

@@ -19,4 +19,4 @@

png.end(buf);
png.end(buffer);
});
};
{
"name": "parse-png",
"version": "1.1.2",
"description": "Parse a PNG",
"license": "MIT",
"repository": "kevva/parse-png",
"author": {
"name": "Kevin Martensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/kevva"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"parse",
"png",
"promise"
],
"dependencies": {
"pngjs": "^3.2.0"
},
"devDependencies": {
"ava": "*",
"file-type": "^4.3.0",
"get-stream": "^3.0.0",
"pify": "^2.3.0",
"xo": "*"
},
"xo": {
"esnext": true
}
"name": "parse-png",
"version": "2.0.0",
"description": "Parse a PNG",
"license": "MIT",
"repository": "kevva/parse-png",
"author": {
"name": "Kevin Martensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/kevva"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"parse",
"png",
"promise"
],
"dependencies": {
"pngjs": "^3.3.0"
},
"devDependencies": {
"ava": "^2.4.0",
"file-type": "^7.2.0",
"get-stream": "^3.0.0",
"xo": "^0.24.0"
}
}

@@ -9,3 +9,3 @@ # parse-png [![Build Status](https://travis-ci.org/kevva/parse-png.svg?branch=master)](https://travis-ci.org/kevva/parse-png)

```
$ npm install --save parse-png
$ npm install parse-png
```

@@ -20,3 +20,5 @@

parsePng(fs.readFileSync('unicorn.png')).then(png => {
(async () => {
const png = await parsePng(fs.readFileSync('unicorn.png'));
console.log(png);

@@ -40,3 +42,3 @@ /*

png.pack().pipe(fs.createWriteStream('unicorn-adjusted.png'));
});
})();
```

@@ -47,9 +49,9 @@

### parsePng(buffer, [options])
### parsePng(buffer, options?)
Returns a promise for a PNG instance. See the [pngjs documentation](https://github.com/lukeapage/pngjs#async-api) for more information.
Returns a `Promise<Object>` with a PNG instance. See the [pngjs documentation](https://github.com/lukeapage/pngjs#async-api) for more information.
#### buffer
Type: `buffer`
Type: `Buffer`

@@ -60,9 +62,4 @@ A PNG image buffer.

Type: `object`
Type: `Object`
See the [pngjs options](https://github.com/lukeapage/pngjs#options).
## License
MIT © [Kevin Martensson](http://github.com/kevva)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc