npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

rn-local-p2p

v0.2.7

Published

Peer to peer connection library over a local network, WiFi, without internet access using UDP

Downloads

41

Readme

rn-local-p2p

Peer to peer connection library over a local network, WiFi, without internet access using UDP

Warning: This library is in pre-release state and should be used with caution. It has not been tested at scale in production environments, and both the API and internal implementations are subject to frequent changes. Use at your own risk.

TODO:

  • Improve test coverage
  • Add created and updated at timestamps to pairings

Installation

npm install rn-local-p2p

Usage

// ...

Creating Router

import { createRouter } from './Router';
import { RequestResponse } from './RequestResponse';

// Define your types
interface Message {
  id: string;
  content: string;
}

const router = createRouter()
  .get('/messages', async () => ({
    status: 200,
    body: [] as Message[],
  }))
  .post('/messages', async (req: HttpRequest<{ content: string }>) => ({
    status: 201,
    body: { id: '123', content: req.body.content } as Message,
  }));

router.initialize(yourRequestResponseInstance);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library


Installation

  1. Install the library:

    npm install your-library-name
  2. React Native Specific Setup (Required):

    Because this library uses Node.js core modules (specifically, crypto and its dependencies), you must use rn-nodeify to make it compatible with React Native. This step is essential for your application to build and run correctly.

    a. Install rn-nodeify as a dev dependency in your application:

    npm install --save-dev rn-nodeify

    b. Run rn-nodeify to install the necessary shims and configure your package.json:

    npx rn-nodeify --install "stream,buffer,events,crypto,vm,process" --hack

    c. Ensure that your package.json has been modified correctly. It should have: _ stream-browserify, buffer, events, vm-browserify and process listed under dependencies. _ rn-nodeify listed under devDependencies. _ A browser field mapping stream, buffer, events, crypto,vm, and process to their respective browserify shims. _ A postinstall script in the scripts section that runs rn-nodeify.

    d. Important: After running rn-nodeify, you must clean your build and restart the Metro bundler:

    • Stop the Metro bundler (Ctrl+C or Cmd+C).
    • Clear Watchman watches: watchman watch-del-all
    • Delete the node_modules directory: rm -rf node_modules
    • Clear Metro Cache: npx react-native start --reset-cache
    • Reinstall dependencies: npm install
    • (iOS Only) Clean and rebuild your iOS project: cd ios && rm -rf Pods && rm -rf build && pod install && cd ..
    • Restart the Metro bundler: npm start
    • Rebuild your application: npx react-native run-android or npx react-native run-ios
  3. Import react-native-get-random-values: Add this line at the very top of the root file (index.js):

    import 'react-native-get-random-values';