npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zip-encrypted

v1.1.1

Published

zip-encrypted is a library for Node.js for compressing and decompressing data and files using passwords.

Downloads

143

Readme

zip-encrypted

zip-encrypted is a Node.js library based on Linux commands that supports creating and extracting zip files with passwords.

Installation

npm install zip-encrypted

Usage

makeZip

  1. Convert JSON data to JSON files and compress those files into a zip file.
const { success, dirPath, zipPath } = await makeZip({
  data: [
    {
      jsonData: {
        test1: 'testData1',
        test2: 'testData2',
      },
      jsonName: 'jsonTestName1.json',
    },
    {
      jsonData: {
        test1: 'testData3',
        test2: 'testData4',
      },
      jsonName: 'jsonTestName2.json',
    },
  ],
  zipPassword: '123',
  dirPath: 'C:\\Users\\user\\Desktop\\info\\sam_test_zip',
});
  1. Compress specified file paths into a zip file.
const { success, dirPath, zipPath } = await makeZip({
  filesPath: [
    'C:\\Users\\user\\Desktop\\info\\test_zip\\first.json',
    'C:\\Users\\user\\Desktop\\info\\test_zip\\second.json',
  ],
  zipPassword: '123',
  dirPath: 'C:\\Users\\user\\Desktop\\info\\sam_test_zip',
});

Option Description

  • Common Request:

    • dirPath
      • type: string
      • Description: Path where the zip file will be created
      • Required: Yes
    • zipPassword
      • type: string
      • Description: Password for creating the zip file (if needed)
      • Required: No
  • For compressing JSON data:

    • data
    • Description: JSON data to be compressed into a zip file
      • type:
{
  jsonData: { [key: string]: any };
  jsonName: string;
}
  • For compressing already existing files:

    • filesPath
      • type: string[]
      • Description: Paths of the files to be compressed
  • Common Return:

    • success
      • type: boolean
      • Description: Success status
    • error
      • type: string
      • Description: Error message (if any)
    • zipPath
      • type: string
      • Description: Path of the zip file
    • dirPath
      • type: string
      • Description: Folder of the zip file

unZip

  1. Download and extract a zip file uploaded on the web.
const { success, error, jsonData } = await unZip({
  url: 'https://www.example-zip.com',
  dirPath: 'C:\\Users\\user\\Desktop\\info\\test_zip',
  zipPassword: '123',
  returnJsonYn: true,
});
  1. Extract an already downloaded zip file.
const { success, error, jsonData } = await unZip({
  zipPath: 'C:\\Users\\user\\Desktop\\info\\test_zip\\a.zip',
  dirPath: 'C:\\Users\\user\\Desktop\\info\\test_zip',
  zipPassword: '123',
  returnJsonYn: true,
});

Option Description

  • Common Request:

    • dirPath
      • type: string
      • Description: Folder path for unzipping the file
      • Required: Yes
    • zipPassword
      • type: string
      • Description: Password for the zip file (if needed)
      • Required: No
    • returnJsonYn
      • type: boolean
      • Description: Whether to return JSON data if the extracted file is a JSON file
      • Required: No
  • For downloading and extracting a zip file uploaded on the web:

    • url
      • type: string
      • Description: URL where the zip file is uploaded
  • For extracting an already downloaded zip file:

    • zipPath
      • type: string
      • Description: Path of the zip file
  • Common Return:

    • success
      • type: boolean
      • Description: Success status
    • error
      • type: string
      • Description: Error message (if any)
    • jsonData
      • type: json
      • Description: Data of the JSON file contained in the zip file (if returnJsonYn is true)

Keywords

zip zip encrypt zip-encrypt zip encrypted zip-encrypted unzip unzip encrypt unzip-encrypt unzip encrypted unzip-encrypted Installation bash