egoist / Franxx
Licence: mit
A vanilla JavaScript router that works everywhere.
Stars: ✭ 255
Programming Languages
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Projects that are alternatives of or similar to Franxx
Router5
Flexible and powerful universal routing solution
Stars: ✭ 1,704 (+568.24%)
Mutual labels: universal, router
Curi
A JavaScript router for single-page applications
Stars: ✭ 262 (+2.75%)
Mutual labels: universal, router
Next Routes
Universal dynamic routes for Next.js
Stars: ✭ 2,354 (+823.14%)
Mutual labels: universal, router
Rill
🗺 Universal router for web applications.
Stars: ✭ 541 (+112.16%)
Mutual labels: universal, router
Minrouter
a micro middleware router for isomorphic javaScript web apps
Stars: ✭ 159 (-37.65%)
Mutual labels: universal, router
Localize Router
An implementation of routes localisation for Angular
Stars: ✭ 177 (-30.59%)
Mutual labels: universal, router
routex.js
🔼 Alternative library to manage dynamic routes in Next.js
Stars: ✭ 38 (-85.1%)
Mutual labels: router, universal
react-hot-loader-starter-kit
react 16, redux 5, react router 4, universal, webpack 3
Stars: ✭ 41 (-83.92%)
Mutual labels: universal
kwerri-oss
Kwerri OSS: samvloeberghs.be + jsonld + seo service + scully-plugin-minify-html + scully-plugin-disable-angular
Stars: ✭ 60 (-76.47%)
Mutual labels: universal
routedux
A router that maps urls to redux actions and vice-versa
Stars: ✭ 19 (-92.55%)
Mutual labels: router
backbone.base-router
A better starting point for building a new Backbone Router.
Stars: ✭ 49 (-80.78%)
Mutual labels: router
alarm-dog
哮天犬是一个通用的统一告警平台,提供配置化、流程化、标准化的能力,支持多种告警通知渠道,支持告警收敛、过滤、升级、工作流、自动恢复等功能,实现统一输入、不同输出。可以对接Grafana、阿里云Arms、实时计算等监控能力,各业务也可以直接在代码中埋点上报告警,也可以定制化开发,实现监控告警全场景覆盖。https://tal-tech.github.io/alarm-dog-docs
Stars: ✭ 165 (-35.29%)
Mutual labels: universal
TG799VAC-XTREME-17.2-MINT
My personal unique wiki for hacking the router firmware used by (Telia)TG799vac Xtream v17.2-MINT delivered from Technicolor
Stars: ✭ 71 (-72.16%)
Mutual labels: router
strickland
Strickland is a JavaScript validation framework with a focus on extensibility and composition
Stars: ✭ 16 (-93.73%)
Mutual labels: universal
http-connection-lifecycle
Complete and detailed explanation of HTTP connection lifecycle
Stars: ✭ 43 (-83.14%)
Mutual labels: router
FRANXX
Install
yarn add franxx
Usage
import { createBrowserRouter, createHashRouter, createMemoryRouter } from 'franxx'
// Router using HTML5 history API
// Widely supported (IE 10 and above)
const router = createBrowserRouter()
// Router using location.hash
// Useful for environments like Electron
// Where you can't use history API
const router = createHashRouter()
// Router using memory
// Mainly for server-side or mobile apps
const router = createMemoryRouter()
router.add('/', () => {
console.log('homepage')
})
router.add('/user/:name', ({ params, query }) => {
console.log(params.name)
})
// The router by default automatically runs route handler
// When URL changes
// But for initial render
// You need to call this:
router.run()
// Go to another page
router.push('/user/egoist?from=NASA#profile')
// Or let us normalize the path for you
router.push({
pathname: '/user/egoist',
query: { from: 'NASA' },
hash: '#profile'
})
Supported path patterns:
- Static (
/foo
,/foo/bar
) - Parameter (
/:title
,/books/:title
,/books/:genre/:title
) - Parameter w/ Suffix (
/movies/:title.mp4
,/movies/:title.(mp4|mov)
) - Optional Parameters (
/:title?
,/books/:title?
,/books/:genre/:title?
) - Wildcards (
*
,/books/*
,/books/:genre/*
)
Note that the order you add routes matters, dynamic routes should always go last, i.e. add /about
before adding *
. We will address this issue in a future version.
CDN
You can also load franxx from JSDelivr or UNPKG:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/franxx.umd.min.js"></script>
<script>
const router = franxx.createBrowserRouter()
</script>
API
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
franxx © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
github.com/egoist · GitHub @egoist · Twitter @_egoistlily
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].