open-index/open-npm huggingface dataset:
npm package: @jimpick/dual-publish
Description: Publish project as dual ES modules and CommonJS package
Author: Andrey Sitnik
Latest version: 0.10.2

# Dual Publish

Publish JS project as dual ES modules and CommonJS package to npm.

* Works with **Node.js**, **browsers**, **React Native**,
  and **bundlers** like webpack or Parcel.
* **No build step.** No need for separated `src/` and `dist/` dirs in repository.
  You will be able to test branch by installing version from GitHub like
  `npm i example@you/example#fix`.
* Keep sources **readable**.
* **Multiple files support**. Your user will be able to import separated files
  like `import { nanoid } from 'nanoid/async'`.
* **Cleans npm package** from development configs [before publishing].

You write CommonJS in your npm library sources:

```js
// index.js
module.exports = { lib }
```

`npx dual-publish` compiles your library during publishing to npm:

```js
// index.js
export { lib }

// index.cjs
module.exports = { lib }

// package.json
{
  …
  "type": "module",
  "module": "index.js",
  "main": "index.cjs",
  "exports": {
    "require": "./index.cjs",
    "import": "./index.js"
  }
}
```

Now your library can be imported natively as ESM or CommonJS:

```js
// CommonJS
let { lib } = require('lib')

// ESM in Node.js, webpack, Parcel, and Rollup
import { lib } from 'lib'

// ESM in browser
import { lib } from 'https://cdn.jsdelivr.net/npm/lib/index.js'
```

[before publishing]: https://github.com/shashkovdanil/clean-publish/

<a href="https://evilmartians.com/?utm_source=dual-publish">
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
      alt="Sponsored by Evil Martians" width="236" height="54">
</a>

## Limits

* We recommend to avoid default export because of [bug in webpack].
* Every JS file should be in own dir. `lib/index.js` instead of `lib.js`.
  We need it to put `package.json` with `module`.

[bug in webpack]: https://github.com/webpack/webpack/issues/6584

## Usage

1. Take a normal CommonJS project with `require()` and `module.exports =`.
2. Because of [bug in webpack] we recommend to use only named exports:

   ```js
   const NAME = 'a'
   function change {
     …
   }

   module.exports = { NAME, change }
   ```
3. Move all files into separated dirs. Rename `lib.js` to `lib/index.js`.
   Old `require('./lib')` will work.
4. Add `dual-publish` to the project:

   ```sh
   npm i --save-dev dual-publish
   ```
5. Test the result by calling `npx dual-publish --check`.
   It will create a folder in your project with converted files.
   Review them manually.
6. Publish your project with `npx dual-publish` instead of `npm publish`.

   ```sh
   npx dual-publish
   ```
npm package: @jimpick/hyperdrive-network-speed
Description: track hyperdrive archive upload and download speeds
Author: Joe Hand
Latest version: 2.1.0-2

# hyperdrive-network-speed

[![Travis](https://img.shields.io/travis/datproject/hyperdrive-network-speed.svg?style=flat-square)](https://travis-ci.org/datproject/hyperdrive-network-speed) [![npm](https://img.shields.io/npm/v/hyperdrive-network-speed.svg?style=flat-square)](https://npmjs.org/package/hyperdrive-network-speed)

Get upload and download speeds for a hyperdrive archive.

## Usage

```js
var archive = hyperdrive('.dat')
var swarm = hyperdiscovery(archive)
var speed = networkSpeed(archive, {timeout: 1000})

setInterval(function () {
  console.log('upload speed: ', speed.uploadSpeed)
  console.log('download speed: ', speed.downloadSpeed)
}, 500)
```

## API

### `var speed = networkSpeed(archive, [opts])`

* `archive` is a hyperdrive archive.
* `opts.timeout` is the only option. Speed will be reset to zero after the timeout.

#### `speed.uploadSpeed`

Archive upload speed across all peers.

#### `speed.downloadSpeed`

Archive download speed across all peers.

#### `speed.downloadTotal`

Archive total download.

#### `speed.uploadTotal`

Archive total upload.

## License

MIT
npm package: @jimpick/libp2p-floodsub
Description: libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).
Latest version: 0.15.1-1

js-libp2p-floodsub
==================

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://libp2p.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-floodsub/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-floodsub?branch=master)
[![Travis CI](https://travis-ci.org/libp2p/js-libp2p-floodsub.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-floodsub)
[![Circle CI](https://circleci.com/gh/libp2p/js-libp2p-floodsub.svg?style=svg)](https://circleci.com/gh/libp2p/js-libp2p-floodsub)
[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-floodsub.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-floodsub) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![](https://img.shields.io/badge/pm-waffle-yellow.svg?style=flat-square)](https://waffle.io/libp2p/js-libp2p-floodsub)

> libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).

## Lead Maintainer

[Vasco Santos](https://github.com/vasco-santos).

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Contribute](#contribute)
- [License](#license)

## Install

```sh
> npm install libp2p-floodsub
```

## Examples

```JavaScript
const FloodSub = require('libp2p-floodsub')

const fsub = new FloodSub(node)

fsub.start((err) => {
  if (err) {
    console.log('Upsy', err)
  }
  fsub.on('fruit', (data) => {
    console.log(data)
  })
  fsub.subscribe('fruit')

  fsub.publish('fruit', new Buffer('banana'))
})
```

## API

See https://libp2p.github.io/js-libp2p-floodsub

## Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## License

MIT © David Dias