{"id":17399245,"url":"https://github.com/feross/chrome-net","last_synced_at":"2025-04-13T02:18:12.781Z","repository":{"id":11741432,"uuid":"14269170","full_name":"feross/chrome-net","owner":"feross","description":"Use the Node `net` API in Chrome Apps","archived":false,"fork":false,"pushed_at":"2023-12-07T15:03:17.000Z","size":219,"stargazers_count":135,"open_issues_count":2,"forks_count":23,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-13T02:17:23.314Z","etag":null,"topics":["chrome-apps","chrome-extension","chrome-net","javascript","net","nodejs","tcp"],"latest_commit_sha":null,"homepage":"https://webtorrent.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feross.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-10T02:14:54.000Z","updated_at":"2025-03-11T04:46:16.000Z","dependencies_parsed_at":"2024-06-18T13:38:02.638Z","dependency_job_id":"bac9af84-1846-49db-ab47-192a819b4bec","html_url":"https://github.com/feross/chrome-net","commit_stats":{"total_commits":175,"total_committers":12,"mean_commits":"14.583333333333334","dds":"0.24571428571428566","last_synced_commit":"e256c468350de505e972c892ca4356f56d5bcc1f"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fchrome-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fchrome-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fchrome-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fchrome-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feross","download_url":"https://codeload.github.com/feross/chrome-net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654104,"owners_count":21140237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome-apps","chrome-extension","chrome-net","javascript","net","nodejs","tcp"],"created_at":"2024-10-16T15:14:00.545Z","updated_at":"2025-04-13T02:18:12.760Z","avatar_url":"https://github.com/feross.png","language":"JavaScript","readme":"# chrome-net [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[travis-image]: https://img.shields.io/travis/feross/chrome-net/master.svg\n[travis-url]: https://travis-ci.org/feross/chrome-net\n[npm-image]: https://img.shields.io/npm/v/chrome-net.svg\n[npm-url]: https://npmjs.org/package/chrome-net\n[downloads-image]: https://img.shields.io/npm/dm/chrome-net.svg\n[downloads-url]: https://npmjs.org/package/chrome-net\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n### Use the Node `net` API in Chrome Apps\n\nThis module lets you use the Node.js [net](https://nodejs.org/api/net.html) (TCP) API in [Chrome Packaged Apps](https://developer.chrome.com/apps/about_apps).\n\nInstead 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](https://github.com/substack/node-browserify) and you're all set!\n\n## install\n\n```\nnpm install chrome-net\n```\n\n## methods\n\nUse node's `net` API, including all parameter list shorthands and variations.\n\nExample TCP client:\n\n```js\nvar net = require('chrome-net')\n\nvar client = net.createConnection({\n  port: 1337,\n  host: '127.0.0.1'\n})\n\nclient.write('beep')\n\nclient.on('data', function (data) {\n  console.log(data)\n})\n\n// .pipe() streaming API works too!\n\n```\n\nExample TCP server:\n\n```js\nvar net = require('chrome-net')\n\nvar server = net.createServer()\n\nserver.on('listening', function () {\n  console.log('listening')\n})\n\nserver.on('connection', function (sock) {\n  console.log('Connection from ' + sock.remoteAddress + ':' + sock.remotePort)\n  sock.on('data', function (data) {\n    console.log(data)\n  })\n})\n\nserver.listen(1337)\n\n```\n\nSee nodejs.org for full API documentation: [net](https://nodejs.org/api/net.html)\n\n## contribute\n\nTo 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 on Windows or Chrome Canary on Mac. If you're on Linux, feel free to send a pull request to fix this limitation.\n\n## license\n\nMIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org), John Hiesey \u0026 Jan Schär.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fchrome-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeross%2Fchrome-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fchrome-net/lists"}