open-index/open-npm huggingface dataset:
npm package: @scarafone/cryptography
Description: Cryptographic wrapper functions built around the `Node:Crypto` package
Author: Brent Scarafone
Latest version: 1.2.0

# Cryptography Package

I wanted to make a JavaScript version of a file encryption/decryption process.

# BREAKING CHANGE

Compared to the first version `0.0.1`, version `1.0.0` makes a big change to how items are encrypted and decrypted. If you have encrypted files using an earlier version, please continue to use that version as it has both a private and public key concept. 

If you wish to migrate to the newer version. I recommend decrypting your files with the older version, update to the new version and either use the same developer-token or generate a new one. Because we aren't using the second key you won't be able to just use the old token to decrypt.



## Usage

Add the package as a dev-dependency to your project
```
npm install @scarafone/cryptography --save-dev
```
You will need to generate a private key.


The **private key** is used to encrypt the file. This could be as simple as a word or phrase or as complicated as a random hash string. 

Now you can import it into your script to encrypt/decrypt a file


```
// CommonJS
const { Decrypt, Encrypt } = require('./cryptography')

// ES Modules
import { Decrypt, Encrypt } from './cryptography'

const privateKey = "your-super-cool-private-key"
const fileLocation = "./data/secret-data.txt"
const destLocation = "./data/secret-data.txt.encrypted 
Encrypt(fileLocation, destLocation, privateKey)
Decrypt(destLocation, fileLocation, privateKey)

```
npm package: @scarafone/files-helper
Description: File helper utility 
Author: Brent Scarafone
Latest version: 0.0.9

# @scarafone/files-helper

Node utility wrapper around base file system functions to provide ease of use functionality for reading, writing and deleting files to the local system that are expected to be in JSON or JS format with utf-8 encoding.

You can pass options through to underlying functions and it will override the defaults. You can also pass false to the parseAsJSON boolean value and it will return the original buffer unchanged.

## Usage Guide

The test cases should do a good job providing how the functions work if you need further details.


```
/// Import
const { 
    closeFile, 
    deleteFile,
    ensureDirectoryExistence,
    createDirectory,
    deleteDirectory,
    readDirectory, 
    readFile, 
    writeFile 
    } = require("@scarafone/files-helper")

/// Execution
// Functions are synchronous

// General use case is for JSON formatted objects, or JS files.
const fileLocation = "./test/location/results.json"

// Write File
// If true, will ensure filepath exists before writing file
const file = writeFile(filePath: fileLocation, data: JSON.stringify({ "key": "value" }), shouldEnsurePathExists: true)

// Read File
// If true, it will return an empty file
file = readFile(filePath: fileLocation, options: {...options}, parseAsJSON: true ) // Default is true

// Delete File
// If true, it won't fail, but path will be created and deleted
const isSuccess = deleteFile(filePath: fileLocation, shouldEnsurePathExists: true)

```

Wrap in `try/catch` blocks in order to catch exceptions raised. Generally speaking though if `shouldEnsurePathExists` is true the operation is not likely to fail in most cases.
npm package: @scarafone/ispawn
Description: Please Populate Description
Author: Brent Scarafone
Latest version: 0.0.2

# iSpawn README

# What is it?

Simple utility function that wraps the child.spawn_process into a promise based function. Allowing for easily spawning commands in an async/await pattern.

# Why does it exists?

Because I needed a utility to do these kinds of commands and I got tired of copying and pasting code between projects.

# How to use it?

```
const iSpawn = require('@scarafone/ispawn')

async function Main() {

    // Execute CLI command
    try {
        const result = await iSpawn("ls", ["-ga"], (data) => {
            console.log({ data })
        })
        console.log({ result })
    } catch (err) {
        console.log({ err })
    }

}

Main()
```
npm package: @scaratek/server
Description: Simple Express Server
Author: Violet
Latest version: 1.0.0

# Server
Simple Express Server

## Example
```js
const Server = require("@scaratek/server"); // Imports the Module

const host = "0.0.0.0"; // Host
const port = 3000; // Port

const dir = "public"; // Directory to Serve
const route = "/" // Route on Server

Server.Route(dir, route); // Routes the Directory

Server.Serve(host, port); // Runs the Server
```

## Documentation
- `Server.Route(*directory*, *route*)` - Will Serve a Directory to a Route
- `Server.Serve(*host*, *port*)` - Will Start a Server
npm package: @scaratek/vise
Description: Violets In-Secure Encryption
Author: violet
Latest version: 1.0.2

# Vise
Violets In-Secure Encryption

## Example
```js
const Vise = require("@scaratek/vise"); // Loads The Module

const Gen = Vise.Generate(); // Generates a Token

Vise.Export(Gen, "./token"); // Exports the Token to a File 
const Token = Vise.Import("./token"); // Imports the Token

const Text = "@scaratek/vise"; // Non-Encoded Text
const Encoded = Vise.Encode(Token, Text); // Encodes Text
const Decoded = Vise.Decode(Token, Encoded); // Decodes Text

// Logs Encoded and Decoded Text
console.log(Encoded);
console.log(Decoded);
```

## Documentation
- `Vise.Generate();` - Generates a Token
- `Vise.Export(*token*, *file path*)` - Exports a Token
- `Vise.Import(*file path*)` - Imports a Token
- `Vise.Encode(*token*, *strong*)` - Encodes Text
- `Vise.Decode(*token*, *encoded string*)` - Decodes Text