All Projects → arnellebalane → Hermes

arnellebalane / Hermes

Licence: mit
Client-side messaging channel for sending data from one browser tab to another

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hermes

Netlify Cms
A Git-based CMS for Static Site Generators
Stars: ✭ 14,776 (+13211.71%)
Mutual labels:  hacktoberfest, npm-package
Hashids.js
A small JavaScript library to generate YouTube-like ids from numbers.
Stars: ✭ 3,525 (+3075.68%)
Mutual labels:  hacktoberfest, npm-package
Node Virtualbox
A JavaScript Library for Interacting with VirtualBox
Stars: ✭ 231 (+108.11%)
Mutual labels:  hacktoberfest, npm-package
MinifyAllCli
📦 A lightweight, simple and easy npm tool to 𝗺𝗶𝗻𝗶𝗳𝘆 JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as 𝑪𝑳𝑰 tool or 𝒊𝒎𝒑𝒐𝒓𝒕𝒂𝒃𝒍𝒆 in TS/JS as a 𝑴𝑶𝑫𝑼𝑳𝑬 🥰
Stars: ✭ 21 (-81.08%)
Mutual labels:  npm-package, client-side
Vuex Persistedstate
💾 Persist and rehydrate your Vuex state between page reloads.
Stars: ✭ 5,561 (+4909.91%)
Mutual labels:  hacktoberfest, localstorage
Inspirational Quotes
💡 A simple NPM Package which returns random Inspirational Quotes. Get your daily quote and stay motivated! ✌️ 🌸
Stars: ✭ 150 (+35.14%)
Mutual labels:  hacktoberfest, npm-package
Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+130.63%)
Mutual labels:  hacktoberfest, npm-package
React Use Localstorage
(seeking maintainers) ⚓ React hook for using local storage
Stars: ✭ 122 (+9.91%)
Mutual labels:  npm-package, localstorage
Secure Ls
🔒 Secure localStorage data with high level of encryption and data compression
Stars: ✭ 486 (+337.84%)
Mutual labels:  hacktoberfest, localstorage
Localstorage
A library to provide access to local storage in Blazor applications
Stars: ✭ 425 (+282.88%)
Mutual labels:  hacktoberfest, localstorage
Highlightjs Line Numbers.js
Line numbering plugin for Highlight.js
Stars: ✭ 323 (+190.99%)
Mutual labels:  hacktoberfest, npm-package
Packagephobia
⚖️ Find the cost of adding a new dependency to your project
Stars: ✭ 1,110 (+900%)
Mutual labels:  hacktoberfest, npm-package
Mevn Cli
Light speed setup for MEVN(Mongo Express Vue Node) Apps
Stars: ✭ 696 (+527.03%)
Mutual labels:  hacktoberfest, npm-package
Jsql
jSQL is the "official" Javascript Query Language - A database written in Javascript for use in a browser or Node.
Stars: ✭ 85 (-23.42%)
Mutual labels:  hacktoberfest, localstorage
React Figma
⚛️ A React renderer for Figma
Stars: ✭ 1,830 (+1548.65%)
Mutual labels:  hacktoberfest
Make Pull Request
Use this as learning repo on how to create successful pull requests. Very basic tasks on Python, HTML, CSS, JavaScript, JAVA.
Stars: ✭ 112 (+0.9%)
Mutual labels:  hacktoberfest
Vscode abap remote fs
Remote filesystem for ABAP systems
Stars: ✭ 111 (+0%)
Mutual labels:  hacktoberfest
Scaffold Static
Scaffolding utility for vanilla-js
Stars: ✭ 111 (+0%)
Mutual labels:  hacktoberfest
React Forms
React library for rendering forms.
Stars: ✭ 111 (+0%)
Mutual labels:  hacktoberfest
Panoramagl
PanoramaGL Android
Stars: ✭ 111 (+0%)
Mutual labels:  hacktoberfest

Hermes

Client-side messaging channel for sending data from one browser tab to another with the same origin. Think of it as a PubSub module that can send messages across multiple browser tabs.

To see a demo of Hermes in action, open this page in multiple browser tabs.

Usage

Get a copy of hermes.js or dist/hermes.min.js and include it in your code:

<script src="/path/to/hermes.js"></script>

Hermes also supports AMD, so it can also be included this way:

require(['path/to/hermes'], function(hermes) { });

Hermes exposes an object named hermes which contains the API methods.

API

  • send(topic, data, [includeSelf=false]): Send data to other browser tabs subscribed to a specified topic.

    • topic: The name of the topic in which the data will be sent to.
    • data: The data to be sent. This needs to be a JSON-serializable object.
    • includeSelf (optional, default=false): A boolean indicating whether the data should also be sent to the current tab.
    hermes.send('some-topic', 'hello world');
    hermes.send('some-topic', { title: 'awesome' });
    hermes.send('some-topic', { title: 'awesome' }, true);
    
  • on(topic, callback): Add a callback function for a specified topic.

    • topic: The name of the topic to subscribe to.
    • callback: The callback function, which accepts a single argument representing the data that was sent originally.
    hermes.on('some-topic', function(data) { });
    
  • off(topic, [callback]): Remove a callback function for a specified topic.

    • topic: The name of the topic to unsubscribe from.
    • callback (optional): The callback function to remove, or don't provide in order to remove all callback functions for the topic topic.
    hermes.off('some-topic', callbackFunction);
    hermes.off('some-topic');
    

License

MIT License

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].