New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

jsbakery

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

jsbakery

Bake up your javascript using the new bake module

latest
npmnpm
Version
0.0.3
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

jsbake

jsbake is a Node.js module that provides various utility classes and functions for file operations, color manipulation, tuples, dice rolling, and converting between RGB and hexadecimal color representations.

Installation

You can install jsbake via npm:

npm install jsbake

Usage

const jsbake = require('jsbake');
const Mix = new jsbake
Mix
// FileOperations
// Create a new folder and file
const folder = new Mix.FileOperations.Folder('example_folder');
folder.Create();
const file = new Mix.FileOperations.File('example_folder/example.txt', 'Hello, world!');
file.Create();

// ColorPalette
// Generate a color palette in Advanced mode
const colorPalette = new Mix.ColorPalette('Advanced');
console.log(colorPalette.Colors.Hex);

// Tuple
// Create an immutable tuple
const Tuple = new Mix.Tuple;
const myTuple = new Tuple(1, 2, 3);

// Dice
// Roll a six-sided die three times
const dice = new Mix.Dice();
const rolls = dice.Roll(3, 6);
console.log(rolls);

// RGB2Hex and Hex2RGB
// Convert RGB to hexadecimal
const RGB2Hex = new Mix.RGB2Hex;
const Hex2RGB = new Mix.Hex2RGB;
const hexValue = RGB2Hex(255, 0, 0);
console.log(hexValue); // Output: #ff0000

// Convert hexadecimal to RGB
const rgbValues = Hex2RGB('#00ff00');
console.log(rgbValues); // Output: [0, 255, 0]

// Bake
// Import specific modules

utilities.ImportModule(["FileOperations", "ColorPalette", "Tuple", "Dice", "RGB2Hex", "Hex2RGB"]);

// Use imported modules
// (See examples above for specific module usage)

Features Overview

FileOperations

Folder Class:

  • constructor(path)
  • Create()
  • Write(file)
  • Contents()
  • Delete()

File Class:

  • constructor(path, content)
  • Create()
  • Write(data)
  • Read()
  • SyncPush()
  • SyncPull()
  • Delete()

ImportFolder Class:

  • Inherits all features from the Folder class.
  • Automatically imports files from a specified folder.

ImportFile Class:

  • Inherits all features from the File class.
  • Automatically imports content from a specified file.

FilePerms Function:

  • FilePerms(path, perms)

ColorPalette

ColorPalette Class:

  • constructor(mode)

Tuple

Tuple Class:

  • constructor(...values)

Dice

Dice Class:

  • constructor()
  • Roll(Dice, Sides)

RGB2Hex and Hex2RGB

RGB2Hex Function:

  • RGB2Hex(R, G, B)

Hex2RGB Function:

  • Hex2RGB(Hex)

Location Class

  • new Location(latitude, longitude);
  • currentLocation.calculateDistance(destination);

Bake

Bake Class:

  • constructor()
  • ImportModule(modules, imports)

More modules coming soon...

FAQs

Package last updated on 29 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts