New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pnkg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pnkg - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "pnkg",
"version": "1.0.2",
"version": "1.0.3",
"description": "PNG bundler",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,2 +13,4 @@ # PNKG [![Build Status](https://api.travis-ci.com/swashvirus/pnkg.svg?branch=main)](https://travis-ci.com/swashvirus/pnkg)

```javascript
const fs = require("fs")
const {PNG} = require("pngjs")
const {pack, unpack} = require("pnkg")

@@ -21,3 +23,9 @@ ```

```
```
Usage: pnkg [options] [command]
Commands:
pack [options] <file>
unpack <file>
help [command] display help for command
```
## Documentation

@@ -27,4 +35,31 @@ _(Coming soon)_

## Examples
_(Coming soon)_
### Packing files
```javascript
fs.createReadStream("<image_path>")
.pipe(new PNG())
.on("parsed", function() {
// read file payload
fs.readFile("<data_file_path>", function (error, file_data) {
if (error) {
throw new Error(error)
}
// override image data with pnkged data.
this.data = pack(new Uint8Array(this.data), new Uint8Array(file_data))
this.pack()
.pipe(fs.createWriteStream("<destination_path>"))
})
})
```
### Unpacking data
```javascript
fs.createReadStream("<destination_path>")
.pipe(new PNG())
.on("parsed", function() {
fs.writeFile("<data_file_path>"), unpack(new Uint8Array(this.data)), function(error) {
if (error) {
throw new Error(error)
}
}
})
```
## Contributing

@@ -31,0 +66,0 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

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