Registry / devops / tcp-bundler

tcp-bundler

JSON →
library1.1.0jsnpmunverified

Vanilla JS/TS bundler using a socket connection to trigger bundling on page refresh. Version 1.1.0. The package acts as a server that listens on a TCP socket; when a filename is sent, it bundles the file and its imports into a single output file. Supports basic import/export operations (import * as, named imports, side-effect imports) and optional TypeScript compilation and minification. Unlike full-featured bundlers like webpack or rollup, it does not support npm package imports and is intended for simple vanilla projects. Release cadence is low; maintenance is unclear.

npm install tcp-bundler
INSTALL
IMPORT
SIG · TCP-BUNDLER
T
tcp-bundler
devopsjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tcpbundler
import tcpbundler from 'tcp-bundler'
const tcpbundler = require('tcp-bundler')
ESM default import or CommonJS require both work.
startListen
import { startListen } from 'tcp-bundler'
import tcpbundler from 'tcp-bundler'; tcpbundler.startListen()
The default export is the object with startListen; named import also works.
startListen (options)
import tcpbundler from 'tcp-bundler'; tcpbundler.startListen('localhost', 9098, { tsc: true })
startListen('localhost', 9098)
Options object is optional but third argument must be an object if provided.

Shows how to programmatically start the tcp-bundler server and trigger bundling by sending a filename via TCP.

import tcpbundler from 'tcp-bundler'; // Start the bundler server on localhost:9098, with TypeScript compilation enabled tcpbundler.startListen('localhost', 9098, { tsc: true }); // Then, from Python or another client, connect to localhost:9098 and send a filename. // The server will bundle that file and its imports into a .js output file. // Example Python client: // import socket // sock = socket.socket() // sock.connect(('localhost', 9098)) // sock.send(b'./src/init.ts') // sock.close()
Debug
Known issues
gotchaThe bundler does not support importing npm packages. Only local relative imports work.
fix
Use rollup or webpack if you need to bundle npm dependencies.
affects: <=1.1.0
gotchaGlobal variables in imported files are not supported; use 'import * as name' instead.
fix
Refactor to export and import explicitly, or use import * as alias.
affects: <=1.1.0
gotchaThe bundler is triggered by sending a filename over TCP; the server must already be running. If no client sends a file, nothing happens.
fix
Ensure you have a client (e.g., Python, curl) that connects and sends the filename after starting the server.
affects: <=1.1.0
Errors
Common errors & fixes
Error: Cannot find module 'tcp-bundler'
Package not installed or installed globally but used locally.
fix
Run 'npm install Sanshain/tcp-bundler' in your project directory.
Error: listen EADDRINUSE :::9098
Port 9098 already in use by another process or previous instance.
fix
Kill the existing process or choose a different port.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
tcp-bundler — npm install tcp-bundler · libregistry