Socket
Book a DemoInstallSign in
Socket

@nomyx/decentranet

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomyx/decentranet

A library for managing multi-context objects in distributed applications

1.0.1
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

@nomyx/decentranet

A powerful library for building decentralized applications that can run seamlessly across browser, server, and peer environments.

npm version License: MIT

Features

  • Multi-context Support: Run your app in browser, server, or peer environments with a unified API.
  • Reactive UI: Build dynamic user interfaces with a reactive component system.
  • Distributed State Management: Easily manage and synchronize state across multiple peers.
  • Peer-to-Peer Communication: Seamless P2P networking with built-in WebRTC support.
  • Plugin System: Extend your app's functionality with a flexible plugin architecture.
  • Development Tools: Comprehensive toolset for debugging and monitoring your decentralized apps.
  • TypeScript Support: Full TypeScript support for enhanced developer experience.

Installation

npm install @nomyx/decentranet

or

yarn add @nomyx/decentranet

Quick Start

Here's a simple example to get you started with a decentralized chat application:

import { DecentralizedApp, Component, GunDataProvider } from '@nomyx/decentranet';

class ChatComponent extends Component<{ messages: string[] }, {}> {
  constructor(contexts: string[], dataProvider: GunDataProvider) {
    super(contexts, dataProvider, { messages: [] }, {});
  }

  render(): string {
    return `
      <div>
        ${this.state.messages.map(msg => `<p>${msg}</p>`).join('')}
      </div>
      <input id="messageInput" type="text">
      <button onclick="sendMessage()">Send</button>
    `;
  }

  sendMessage(message: string) {
    this.setState({ messages: [...this.state.messages, message] });
  }
}

const app = new DecentralizedApp(new GunDataProvider());

app.initialize().then(() => {
  const chatComponent = new ChatComponent(['browser'], app.gunDataProvider);
  chatComponent.mount(document.getElementById('app')!);
  app.start();
});

Documentation

For more detailed information about using @nomyx/decentranet, please refer to our comprehensive guide.

API Reference

Detailed API documentation can be found here.

Examples

Check out our examples directory for more complex usage scenarios and best practices.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

@nomyx/decentranet is MIT licensed.

Support

If you encounter any issues or have questions, please file an issue on our GitHub issue tracker.

Acknowledgements

@nomyx/decentranet is built on top of several amazing open-source projects, including GunDB, WebRTC, and many others. We're grateful for their contributions to the open-source community.

Stay Connected

Happy decentralized app building!

Keywords

multi-context

FAQs

Package last updated on 12 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.