Welcome to UP.js - a versatile JavaScript utility library designed to make DOM manipulation, text processing, and file handling easier! 🎉
Simply include the UP.js
script in your HTML file:
<script src="path/to/UP.js"></script>
Or import it in your JavaScript project:
import UP from 'path/to/UP.js';
Manipulate DOM elements with a fluent interface:
// Select an element and chain methods to set multiple properties
let myElement = new UP("#myElement");
myElement.setC("red")
.setBg("yellow")
.setD("block")
.setW("100px")
.setH("100px")
.setHTML("Hello World!");
Process text with ease:
// Extract text after a specific character
let result = UP.text.beforeDate("example.txt", '.'); // Output: "txt"
// Get text between two characters
let betweenText = UP.text.getText("Hello [world]!", '[', ']'); // Output: "world"
// Split text using multiple delimiters
let array = UP.text.multiArr("apple,orange|banana&grape", ',', '|', '&');
// Output: ["apple", "orange", "banana", "grape"]
Work with URL parameters and hashes:
// Get the value of a query parameter
let value = UP.url.search("key"); // Output: value of 'key' in the URL
// Get the hash from the URL
let hash = UP.url.hesh(true); // Output: #hashValue
Load and process files easily:
// Load a JSON file
let data = UP.fill.view("path/to/file.json", 'json');
// Load and auto-detect file type
let autoData = UP.fill.viewAutoType("path/to/file.json");
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to contribute, raise issues, or share your thoughts! Happy coding! 💻🚀