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

pheonix-box

v1.0.2

Published

This is a Typescript Project and NPM Module Along with exported access to the JohnsPheonixBox class object. For usage in NodeJS runtime!

Downloads

182

Readme

Pheonix Box NPM

Pheonix Box is a TypeScript project that is compiled, bundled with Webpack, and obfuscated into a binary. It provides a robust tamper-proof solution for managing and processing files with encryption and hashing capabilities. This NPM module exposes the JohnsPheonixBox class object for public use.

Table of Contents

Installation

To install the package, run:

npm install pheonix-box

Usage

To use the JohnsPheonixBox class, import it into your project:

import { JohnsPheonixBox } from 'pheonix-box';

const pheonixBox = new JohnsPheonixBox();

Configuration

The configuration is managed through the Config class. You can customize various settings such as paths, encryption keys, and debug options.

Configuration File

The configuration is stored in a JSON file named configurable.json. Here is an example of what the configuration file might look like:

{
    "paths": ["src", "dist"],
    "fileTypes": [".ts", ".js"],
    "fileRegexs": ["\\.test\\.ts$", "\\.spec\\.ts$"],
    "useFileTypes": true,
    "useFileRegexs": false,
    "useCeaserCipher": false,
    "useAesKey": true,
    "forkDelay": 1,
    "forkExecutionDelay": 1,
    "threads": 4,
    "whiteSpaceOffset": 2,
    "debug": true
}

Configuration Options

  • paths: An array of paths to include in the processing.
  • fileTypes: An array of file extensions to include.
  • fileRegexs: An array of regular expressions to match file names.
  • useFileTypes: A boolean indicating whether to use file types for filtering.
  • useFileRegexs: A boolean indicating whether to use regular expressions for filtering.
  • useCeaserCipher: A boolean indicating whether to use Caesar Cipher for encryption.
  • useAesKey: A boolean indicating whether to use AES encryption.
  • forkDelay: A number indicating the delay between forks.
  • forkExecutionDelay: A number indicating the delay between fork executions.
  • threads: The number of threads to use for processing.
  • whiteSpaceOffset: The number of spaces to use for indentation.
  • debug: A boolean indicating whether to enable debug mode.

Methods

The Config class provides several methods to manage the configuration:

  • addPath(path: string): Adds a new path to the configuration.
  • removePath(path: string): Removes a path from the configuration.
  • addFileType(fileType: string): Adds a new file type to the configuration.
  • removeFileType(fileType: string): Removes a file type from the configuration.
  • addFileRegex(regex: string): Adds a new file regex to the configuration.
  • removeFileRegex(regex: string): Removes a file regex from the configuration.
  • saveConfigP(): Saves the current configuration to the file.

Example Usage

Here is an example of how to use the Config class:

import { Config } from 'pheonix-box';

const config = new Config();

// Add a new path
config.addPath('new/path');

// Remove an existing path
config.removePath('old/path');

// Add a new file type
config.addFileType('.jsx');

// Remove an existing file type
config.removeFileType('.js');

// Save the updated configuration
config.saveConfigP();

This will update the configurable.json file with the new settings.

Debugging

If you enable the debug option, the Config class will log messages to the console, which can help you troubleshoot issues with your configuration.

const config = new Config();
config.debug = true;
config.addPath('new/path'); // This will log a message to the console

Runtime Configuration

You can now specify a configuration setup at runtime to enable tamper-proofing of binaries without requiring additional binary bundling processes. This feature allows you to dynamically adjust the configuration based on runtime conditions.

import { JohnsPheonixBox, Config } from 'pheonix-box';
//Easy 6 line setup to protect ones runtimes in a nodeJS binary enjoy!
const runtimeConfig = new Config();
runtimeConfig.addPath('new/path'); // This will log a message to the console
runtimeConfig.debug = true; //enable console log debugs!
runtimeConfig.forkDelay = 1000; //how many milliseconds do you want to delay checks!
runtimeConfig.forkExecutionDelay = 1000; //how many milliseconds do you want to delay checks!
runtimeConfig.threads = 1; //Limit to single thread to not waste resources!
const pheonixBox = new JohnsPheonixBox(runtimeConfig);
//First parameter is are we using npm tamper check if so true
//Second parameter are we binary tamper check if so true!
//Third parameter are we using local path references! if so true
//If third parameter is true fourth parameter doesn't matter!
//Fourth parameter are we using __dirname if so true if false we use process.cwd() if not using local references!
pheonixBox.initRuntimeProtect(false, true, true, false);//This will automatically load up runtime configuration settings required!
pheonixBox.startProcess(); //This will start the process of checking for tampering!
//

By following this guide, you can effectively manage and customize the configuration for the Pheonix Box project.

License

This project is licensed under the X11 License. See the LICENSE file for details.

For more information on the binary version of Pheonix Box, please visit the GitHub repository.