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

shrink-string

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shrink-string - npm Package Compare versions

Comparing version 3.1.7 to 3.1.9

12

package.json
{
"name": "shrink-string",
"description": "Tiny string compression module for Node.",
"version": "3.1.7",
"version": "3.1.9",
"author": {

@@ -14,3 +14,3 @@ "email": "zac@zacanger.com",

"build": "tsc",
"prebuild": "sortpack prettier --write src/*.ts && npm t",
"prebuild": "sortpack && ts-standard --fix src/*.ts && npm t",
"preversion": "npm run build",

@@ -23,3 +23,3 @@ "test": "npm run test:tape",

"type": "git",
"url": "https://github.com/zacanger/shrink-string.git"
"url": "git+https://github.com/zacanger/shrink-string.git"
},

@@ -35,7 +35,7 @@ "bugs": "https://github.com/zacanger/shrink-string/issues",

"devDependencies": {
"@types/node": "20.3.3",
"prettier": "2.8.8",
"@types/node": "20.6.4",
"sortpack": "2.3.4",
"tape-async": "2.3.0",
"typescript": "5.1.6"
"ts-standard": "12.0.2",
"typescript": "5.2.2"
},

@@ -42,0 +42,0 @@ "engines": {

@@ -1,21 +0,21 @@

import { gzip, gunzip } from 'zlib';
import { promisify } from 'util';
import { Buffer } from 'buffer';
import { gzip, gunzip } from 'zlib'
import { promisify } from 'util'
import { Buffer } from 'buffer'
const gz = promisify(gzip);
const ugz = promisify(gunzip);
const gz = promisify(gzip)
const ugz = promisify(gunzip)
const compress = async (s: string = ''): Promise<string> => {
const compressed = await gz(s);
return Buffer.from(compressed).toString('base64');
};
const compressed = await gz(s)
return Buffer.from(compressed).toString('base64')
}
const decompress = async (s: string = ''): Promise<string> => {
const decompressed = await ugz(Buffer.from(Buffer.from(s, 'base64')));
return decompressed.toString();
};
const decompressed = await ugz(Buffer.from(Buffer.from(s, 'base64')))
return decompressed.toString()
}
export = {
compress,
decompress,
};
decompress
}
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