![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
chrome-dgram
Advanced tools
dgram
API in Chrome AppsThis module lets you use the Node.js dgram (UDP) API in Chrome Packaged Apps.
Instead of learning the quirks of Chrome's chrome.sockets
API for networking in Chrome Apps just use the higher-level node API you're familiar with. Then, compile your code with browserify and you're all set!
This module is used by webtorrent.
npm install chrome-dgram
Use node's dgram
API, including all parameter list shorthands and variations.
Example UDP client/bind:
var dgram = require('chrome-dgram')
var sock = dgram.createSocket('udp4')
sock.send('beep', 0, 'beep'.length, 1337, '127.0.0.1')
sock.on('message', function (data, rInfo) {
console.log('Got data from ' + rInfo.address + ':' + rInfo.port)
console.log(data)
})
See nodejs.org for full API documentation: dgram
To run tests, use npm test
. The tests will run TCP and UDP servers and launch a few different Chrome Packaged Apps with browserified client code. The tests currently require Chrome Canary on Mac. If you're on Windows or Linux, feel free to send a pull request to fix this limitation.
MIT. Copyright (c) Feross Aboukhadijeh & John Hiesey.
FAQs
Use the Node `dgram` API in Chrome Apps
The npm package chrome-dgram receives a total of 5,626 weekly downloads. As such, chrome-dgram popularity was classified as popular.
We found that chrome-dgram demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.