1.0.0 • Published 1 year ago
simplijq v1.0.0
simplijq - A JavaScript Library to Simulate jQuery
Description
simplijq is a lightweight JavaScript library that simulates the basic functionalities of jQuery.
Installation
npm install simplijqUsage
Basic Usage
import jq from 'simplijq';
const $ = jq;
$(document).ready(function() {
$(".btn").hide();
});Methods
- ready(callback): Executes the callback function when the DOM is fully loaded.
- hide(): Hides the selected elements.
- show(): Shows the selected elements.
Example
Here is an example of using simplijq in an HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Library simplijq</title>
</head>
<body>
<button class="btn">click me!</button>
<script src="bundle.js"></script>
</body>
</html>And in your JavaScript file:
import jq from 'simplijq';
const $ = jq;
$(document).ready(function() {
$(".btn").hide();
});Development
Linking Locally
1.In the library project directory, run:
npm link2.In the test project directory, run:
npm link jq3.Now you can import and use simplijq in your test project.
Build and Serve
To build and serve the library, run the following commands in the library directory:
npm run build
npm run startThis will build the library and start a development server.
1.0.0
1 year ago