node-morgoth
v0.2.0
Published
From the depths of the forge, utilities for your Node.js project(s).
Maintainers
Readme
Node Morgoth
Still under development... Do not use it in production-grade project(s) until the version reaches 1.0.0
node-morgoth
Forge dark and powerful utilities for Node.js.
A mythic toolkit for Node.js craftsmen: file & folder manipulation, security helpers (JWT, bcrypt), and more — all forged in the depths of Morgoth’s forge.
✨ Why node-morgoth?
In Tolkien’s lore, Morgoth was the first dark lord, a master forger who shaped the very fabric of the world (and many of its darkest tools).node-morgoth brings that same spirit of creation and control to your Node.js project(s):
📦 Install
Choose your preferred package manager:
npm i node-morgothpnpm add node-morgothyarn add node-morgoth⚡ Features
- ⚙️ Crafted for Node.js: Built with modern ESM and TypeScript.
- 🌑 More Coming Soon: Like Morgoth’s endless forges.
🛠️ Usage Guides
File Conversion Utilities
fileToBase64
Convert a file on disk to a Base64 string (async):
import { fileToBase64 } from 'node-morgoth';
const base64 = await fileToBase64('path/to/file.png');
console.log(base64); // → Base64 stringfileToBase64Sync
Convert a file on disk to a Base64 string (sync):
import { fileToBase64Sync } from 'node-morgoth';
const base64 = fileToBase64Sync('path/to/file.png');
console.log(base64); // → Base64 stringcreateVirtualFileBase64
Create a Base64 string from given text content:
import { createVirtualFileBase64 } from 'node-morgoth';
const base64 = createVirtualFileBase64('Hello Morgoth!');
console.log(base64); // → Base64 stringbase64ToFile
Recreate a browser File object from a Base64 string:
import { base64ToFile } from 'node-morgoth';
const file = base64ToFile(base64String, 'example.txt', 'text/plain');
console.log(file); // → File object (browser)textToBase64
Convert plain text to Base64:
import { textToBase64 } from 'node-morgoth';
const base64 = textToBase64('Forge the dark tools');
console.log(base64); // → Base64 stringbase64ToText
Decode Base64 back to plain text:
import { base64ToText } from 'node-morgoth';
const text = base64ToText(base64String);
console.log(text); // → original text🔗 Related Packages
License
This project is licensed under the MIT License with the following additional requirement:
Additional Requirement:
Any fork, derivative work, or redistribution of this project must include clear attribution to Nazmul Hassan in both the source code and any publicly available documentation.
You are free to use, modify, and distribute this project under the terms of the MIT License, provided that appropriate credit is given.
