npm.io
5.0.0 • Published 2 years ago

onedionys-client-side-routing-utilities

Licence
ISC
Version
5.0.0
Deps
133
Size
13 kB
Vulns
0
Weekly
0
Stars
2

Welcome to One Dionys - Client-Side Routing Utilities!

A utility to handle client-side routing, allowing navigation between pages without the need to reload the entire page.

Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

How To Use

Example Syntax
import { Router } from 'client-side-routing-utils';

const router = new Router();

router.addRoute('/', () => {
    console.log('Home Page');
});

router.addRoute('/about', () => {
    console.log('About Page');
});

router.navigate('/about');
Explanation
  • This package provides utilities for client-side routing in web applications. It allows you to define routes and corresponding handlers, and navigate between routes using hash-based URLs.
Return Value
  • Router: Class for managing client-side routing.
  • RouteHandler: Function type for handling route changes.
  • RouteParams: Interface for storing route parameters.

Release Date

  • v1.0.0 : 17 March 2024
  • v1.0.1 : 18 March 2024
  • v1.0.2 : 20 March 2024
  • v5.0.0 : 31 March 2024

Author

License

  • Copyright 2024 One Dionys
  • One Dionys - Client-Side Routing Utilities is an open source project licensed under the MIT license

Suppport & Donation

Love One Dionys - Client-Side Routing Utilities? Support this project by donating or sharing with others in need.

Made with One Dionys

Keywords