{"_id":"tcp-base","_rev":"942342","name":"tcp-base","description":"A base class for tcp client with basic functions","dist-tags":{"latest":"3.2.0"},"maintainers":[{"name":"coderhaoxin","email":"haoxinst@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@gmail.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"time":{"modified":"2024-08-03T11:20:00.000Z","created":"2016-09-18T04:52:17.842Z","3.2.0":"2023-08-30T14:11:49.006Z","3.1.1":"2022-09-01T14:55:50.049Z","3.1.0":"2017-12-01T06:39:23.880Z","1.1.2":"2017-08-16T06:34:45.499Z","1.1.1":"2017-08-11T08:39:26.291Z","3.0.0":"2017-04-20T03:44:19.913Z","2.0.0":"2017-02-17T13:21:01.363Z","1.1.0":"2016-11-30T03:14:45.449Z","1.0.2":"2016-11-11T02:44:07.790Z","1.0.1":"2016-10-20T04:31:33.347Z","1.0.0":"2016-09-18T04:52:17.842Z"},"users":{},"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"versions":{"3.2.0":{"name":"tcp-base","version":"3.2.0","description":"A base class for tcp client with basic functions","main":"lib/base.js","scripts":{"lint":"eslint --ext .js .","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 6.0.0"},"devDependencies":{"egg-bin":"^5.2.0","eslint":"^8.23.0","eslint-config-egg":"^12.0.0","mm":"^2.1.0","mz-modules":"^1.0.0","pedding":"^1.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^3.1.1"},"gitHead":"a13f7c099358af78073bc9e75484aa7bd7486e95","_id":"tcp-base@3.2.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-fFAqH8QTbheuEbXLdbxTSe31Gkw6Lg3nq4loyrxIXM6+ILGdbYXEblgyuu7UltOkOHbP/q2iqaC+gIXXu0C5bg==","shasum":"bc83618edb26bb17bb9b082216ec242ec9137480","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-3.2.0.tgz","fileCount":4,"unpackedSize":16437,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+8Zz90E5YCDJVFfT2lh9OGa4gge4/5zAQLZ+EsN4f2AiEArpNo/pbf/mi7eIAOKV6YW+o5HummfCSP89+AkxhsEb8="}],"size":5420,"noattachment":false,"key":"/tcp-base/-/tcp-base-3.2.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"coderhaoxin","email":"haoxinst@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@gmail.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tcp-base_3.2.0_1693404708851_0.16258012876931227"},"_hasShrinkwrap":false,"publish_time":1693404709006,"_cnpm_publish_time":1693404709006},"3.1.1":{"name":"tcp-base","version":"3.1.1","description":"A base class for tcp client with basic functions","main":"lib/base.js","scripts":{"lint":"eslint --ext .js .","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","contributors":"contributors"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 6.0.0"},"ci":{"version":"14, 16, 18","os":"linux"},"devDependencies":{"contributors":"^0.5.1","egg-bin":"^5.2.0","egg-ci":"^2.1.0","eslint":"^8.23.0","eslint-config-egg":"^12.0.0","mm":"^2.1.0","mz-modules":"^1.0.0","pedding":"^1.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^3.1.1"},"gitHead":"d9d7084593b461db7335062d41dbc200e82df78c","_id":"tcp-base@3.1.1","_nodeVersion":"16.17.0","_npmVersion":"6.14.12","dist":{"integrity":"sha512-6wS2yvxq7xqhlpjHPLCYsuy6hIu1HFP3vDqfa1swjQ14MHIz2TW32CvY3hOrt6eM0tmUmy+1rsy52JKqD9hkjQ==","shasum":"7daf9599b148919bc12fc3df14f49b89b748cca1","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-3.1.1.tgz","fileCount":5,"unpackedSize":17833,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwkB8/cJG3zF5Z0cqywTwe9L6SQIxcPtyGSKDsmnMm+QIge5d+Y94+raX8jeNOXxJchX9Gros7gc/F1IlQfBfLdSo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEMf2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQCxAAi/KpJCcKVOJTRKf0oPwl3Mavf70i/7gjqIe5XQ0BcDKZjGnP\r\nwQMjOryyfBeFGAYH2goxVprjYNCziC0SIy8+zIe6rZUj24nwUaStJ9txVjbJ\r\ndBi0zC0Kc3nID5uInj37zmmW629c9WmLma2jCQwDWNBO0e90d75w9WDOHorX\r\nNjx6d5Y2G33eJI3La8wAuIziAbermwLlNFZYSpNPWRRFb2kUbbDGNzCJTW0s\r\nVRPhmVivPwh0hR8sCTZItI6yG4fcY45Z/FiZXvbUh9Q8I5MRa5/ByEBWdbmX\r\nqBE+VyXYNKytxGlN0bSegD148v1CIIu+9dNJBLfGkzFbcvwkibGP/B+4Laia\r\nQtKlE2Im5DVaRmb+6FbWHK9KAiYVh9EXvJM/gZ9bclr/0HVzoTKHJZi0/jEs\r\nH0VWzzj3hfzzpM4sY24ngo3575WVzfM5MPNKVErImME1mrYxvvSqVpV1dL7Q\r\n9tNoJJwJFARcsHs3p7A7mGCWswk1b5wnt13gjEdWWgy6LeaNqh6CNTgzlPEg\r\nYj0B8d2NApel96zeD5kexZq0InVCbR/mDkFutFwfZTm3QK7NnUGqpDyKphIh\r\n10GPB2cpXUhtZyLUvy6Umj7fl7PuIrjheFZlGEuvylAERnYvuU6CndaDcOX1\r\naV8t/5nb0N1+im39vDK/vZ4mjeDZ7KySjtM=\r\n=xVEF\r\n-----END PGP SIGNATURE-----\r\n","size":6088,"noattachment":false,"key":"/tcp-base/-/tcp-base-3.1.1.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"coderhaoxin","email":"haoxinst@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@gmail.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tcp-base_3.1.1_1662044149868_0.28088717609108604"},"_hasShrinkwrap":false,"publish_time":1662044150049,"_cnpm_publish_time":1662044150049},"3.1.0":{"name":"tcp-base","version":"3.1.0","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"autod":"autod","lint":"eslint --ext .js .","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","contributors":"contributors"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 6.0.0"},"ci":{"version":"6, 7"},"devDependencies":{"autod":"^2.8.0","contributors":"^0.5.1","egg-bin":"^3.3.0","egg-ci":"^1.6.0","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","mz-modules":"^1.0.0","npminstall":"^2.29.1","pedding":"^1.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^3.1.1"},"gitHead":"531f1353543400967a5980c3fd9a634506f74d07","_id":"tcp-base@3.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.4.0","_npmUser":{"name":"gxcsoccer","email":"gxcsoccer@gmail.com"},"dist":{"integrity":"sha512-5iTlUaVmeZBzyq9cSVjB4mzKtvBP2wpkbVZoMdRhFwq35DYUBAfeTgAD31NYJSba3HVxetjuqKlAkUUHlWoShw==","shasum":"35458bf8c0a21a0cacf5092b4c758a53b39317c1","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-3.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzbnjgIAPmilDjs286tKiUFiKWW4J5j+YZJpdgBE6y/AIhAPEdOtyO0qEOz23rnim2Oc5XzTGOuepNts4AMmXv9b2T"}],"size":5980,"noattachment":false,"key":"/tcp-base/-/tcp-base-3.1.0.tgz"},"maintainers":[{"name":"coderhaoxin","email":"haoxins@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tcp-base-3.1.0.tgz_1512110363813_0.03317421954125166"},"directories":{},"publish_time":1512110363880,"_cnpm_publish_time":1512110363880},"1.1.2":{"name":"tcp-base","version":"1.1.2","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"autod":"autod","lint":"eslint --ext .js .","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"TEST_TIMEOUT=20000 egg-bin cov","ci":"npm run lint && npm run cov","contributors":"contributors"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 4.0.0"},"ci":{"version":"4, 6, 7"},"devDependencies":{"autod":"^2.9.0","await-event":"^2.1.0","contributors":"^0.5.1","egg-bin":"^1.11.1","egg-ci":"^1.8.0","eslint":"^4.4.1","eslint-config-egg":"^5.0.0","mm":"^2.1.0","mz-modules":"^1.0.0","pedding":"^1.1.0","webstorm-disable-index":"^1.2.0"},"dependencies":{"is-type-of":"^1.1.0","sdk-base":"^2.0.1"},"gitHead":"dec0b86ce827ebb272781b41dd3cd43262c2da9b","_id":"tcp-base@1.1.2","_npmVersion":"5.3.0","_nodeVersion":"8.1.4","_npmUser":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"maintainers":[{"name":"coderhaoxin","email":"haoxins@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"}],"dist":{"integrity":"sha512-tibCPmXfqit2SHUcS5qohuHvt27uUpbxFd++brwrlHnQxiyjZQSrOXHKfWd/P6Lm6215WxwtzoimocysgOA+iw==","shasum":"ec669ec1553897e74862dcb541fce3bc8e093131","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-1.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzUyh4JFXiP/J8CqntZVxGVOxTD3RO9TMmVXZ1jOonsAiEAgQtradrDZF5zDwPKcmCf7IEljKR6PBCkgtZPkrSSG6E="}],"size":5821,"noattachment":false,"key":"/tcp-base/-/tcp-base-1.1.2.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tcp-base-1.1.2.tgz_1502865285407_0.7274039876647294"},"directories":{},"publish_time":1502865285499,"_cnpm_publish_time":1502865285499},"1.1.1":{"name":"tcp-base","version":"1.1.1","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"autod":"autod","lint":"eslint --ext .js .","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"TEST_TIMEOUT=20000 egg-bin cov","ci":"npm run lint && npm run cov","contributors":"contributors"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 4.0.0"},"ci":{"version":"4, 6, 7"},"devDependencies":{"autod":"^2.9.0","await-event":"^2.1.0","contributors":"^0.5.1","egg-bin":"^1.11.1","egg-ci":"^1.8.0","eslint":"^4.4.1","eslint-config-egg":"^5.0.0","mm":"^2.1.0","mz-modules":"^1.0.0","pedding":"^1.1.0","webstorm-disable-index":"^1.2.0"},"dependencies":{"is-type-of":"^1.1.0","sdk-base":"^2.0.1"},"gitHead":"498b18a89a31df20a2f8b76c433346cd85355ff5","_id":"tcp-base@1.1.1","_npmVersion":"5.3.0","_nodeVersion":"8.1.4","_npmUser":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"maintainers":[{"name":"coderhaoxin","email":"haoxins@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"}],"dist":{"integrity":"sha512-2zwFChjJirCQfO20Tn6ydosAMDdusEZm6NjVD3w9+L68eXrLQXP/d8mhmKSFlDqfp8p1eKdcJIjo1Vk2X7FOoA==","shasum":"e2f7ff058b08c6a336645494148b499168f0582e","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-1.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1RgTj8lxJFj1FHSQb5pu1CoZ5VmoJ78PEffeVibFRYwIgO2RJrJAUwe7MXdO28cawN8I/8Kir9xmg7v9nHgzfOks="}],"size":5739,"noattachment":false,"key":"/tcp-base/-/tcp-base-1.1.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tcp-base-1.1.1.tgz_1502440766198_0.7347863144241273"},"directories":{},"publish_time":1502440766291,"_cnpm_publish_time":1502440766291},"3.0.0":{"name":"tcp-base","version":"3.0.0","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"autod":"autod","lint":"eslint --ext .js .","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","contributors":"contributors"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 6.0.0"},"ci":{"version":"6, 7"},"devDependencies":{"autod":"^2.8.0","contributors":"^0.5.1","egg-bin":"^3.3.0","egg-ci":"^1.6.0","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","mz-modules":"^1.0.0","npminstall":"^2.29.1","pedding":"^1.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^3.1.1"},"gitHead":"f9c56ee64afb38b4062e5f1a247db45cbce4192c","_id":"tcp-base@3.0.0","_shasum":"6156da6b6dd1d4a40d8379467f25ef1f9c946437","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"maintainers":[{"name":"coderhaoxin","email":"haoxins@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"}],"dist":{"shasum":"6156da6b6dd1d4a40d8379467f25ef1f9c946437","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-3.0.0.tgz","integrity":"sha512-xwPIVG7coP4Irm6t7oE0k5MRDYmqJr8XJ+N+0TpGI/GACieABK0BMYorb3FcYf0B1r1RjjSsKZvsk7pTKjIWNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDD47MwonAdQuT3byZk9986BQNzqlFnJIWVBvuxuxXE0AIhAKTui2srEf+3dg1Dt5t4aBe6vk+QdVSd6I5uRQ19gCtt"}],"size":5750,"noattachment":false,"key":"/tcp-base/-/tcp-base-3.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tcp-base-3.0.0.tgz_1492659857968_0.7933136411011219"},"directories":{},"publish_time":1492659859913,"_cnpm_publish_time":1492659859913},"2.0.0":{"name":"tcp-base","version":"2.0.0","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"autod":"autod -w --prefix '^'","lint":"eslint --ext .js lib test example","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 6.0.0"},"ci":{"version":"6, 7"},"devDependencies":{"autod":"^2.7.1","egg-bin":"^2.2.0","egg-ci":"^1.1.0","eslint":"^3.15.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","npminstall":"^2.24.0","pedding":"^1.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^3.1.0"},"gitHead":"1a379f3a6b084abb1e40f86d6a0918a9895b6ef6","_id":"tcp-base@2.0.0","_shasum":"cd9b2ec4fb033d090df2176e58637269180a3818","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"maintainers":[{"name":"coderhaoxin","email":"haoxins@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"},{"name":"shaoshuai0102","email":"shaoshuai0102@gmail.com"}],"dist":{"shasum":"cd9b2ec4fb033d090df2176e58637269180a3818","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-2.0.0.tgz","integrity":"sha512-RFHxBK7eXlwfZICrE+EwDI+6xEuVAZGHkAtz2DCZqnSiwWi1X7UqNjGXaFvYIAapbyjawRCApsWMFq+v9k93kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpjPO8N63d+TLk96eM9Nmfy+f8kiYVELMFGlVlpt1gAQIgNZuQ6kgnvCyn5/8R7LBTw/iDieUftmQqTUT4k0qGeTs="}],"size":5669,"noattachment":false,"key":"/tcp-base/-/tcp-base-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tcp-base-2.0.0.tgz_1487337659578_0.759924108395353"},"directories":{},"publish_time":1487337661363,"_cnpm_publish_time":1487337661363},"1.1.0":{"name":"tcp-base","version":"1.1.0","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"lint":"eslint --ext .js lib test example","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint -- --fix && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 4.0.0"},"ci":{"version":"4, 6, 7"},"devDependencies":{"egg-bin":"1","egg-ci":"1","eslint":"3","eslint-config-egg":"3","mm":"2","npminstall":"2","pedding":"1","should":"11"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^2.0.1"},"gitHead":"74cb511afc10a196104ce4789811af9e1b681c1f","_id":"tcp-base@1.1.0","_shasum":"5b2dcffbc51fb3c3add05c298388be34e6470cd4","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"dist":{"shasum":"5b2dcffbc51fb3c3add05c298388be34e6470cd4","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-1.1.0.tgz","integrity":"sha512-rc1C6Ux/EAv4SyoLdScVPgdJmkodkYO06YrGZPkTcV8PIoB98rPa1BEUiWTC+zNh5NtvOZtsQz+RJ3BDi37oGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdMnqkajepPT3xSaYW6h70grpj3TK8w7FXmQoJ5Zw/2gIgf1bElOFX+WLVLpSpYJhPqI2a0gTTt6PXaamy/s7cJ0U="}],"size":5593,"noattachment":false,"key":"/tcp-base/-/tcp-base-1.1.0.tgz"},"maintainers":[{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tcp-base-1.1.0.tgz_1480475684826_0.09407295333221555"},"directories":{},"publish_time":1480475685449,"_cnpm_publish_time":1480475685449},"1.0.2":{"name":"tcp-base","version":"1.0.2","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"lint":"eslint --ext .js lib test example","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint -- --fix && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 4.0.0"},"ci":{"version":"4, 6"},"devDependencies":{"egg-bin":"1","egg-ci":"1","eslint":"3","eslint-config-egg":"3","mm":"2","npminstall":"2","pedding":"1","should":"11"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^2.0.1"},"gitHead":"277aceed35b71266bac6d06c3c474fcfdf10976b","_id":"tcp-base@1.0.2","_shasum":"69e2c43133bd56935c4fb5a7afcd588328dde6d3","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"dist":{"shasum":"69e2c43133bd56935c4fb5a7afcd588328dde6d3","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-1.0.2.tgz","integrity":"sha512-VPVTlN9ocp+XOThWxo9nsU1NE2pGSf5faClqQ182untgZSNTUNaccyMMJvyxQuKRMJEWtDhRYZlxA+PJ6y45wA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDARUPttys3X3ZV3pd53lX2SUEZSB4dnhppUqPq6HGOPAiBztlXJHEeE7SjUJqNgaoSXzbGQrVrpeQvAEL4oDq7wuA=="}],"size":5552,"noattachment":false,"key":"/tcp-base/-/tcp-base-1.0.2.tgz"},"maintainers":[{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tcp-base-1.0.2.tgz_1478832247254_0.40998436394147575"},"directories":{},"publish_time":1478832247790,"_cnpm_publish_time":1478832247790},"1.0.1":{"name":"tcp-base","version":"1.0.1","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"lint":"eslint --ext .js lib test example","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 4.0.0"},"ci":{"version":"4, 6"},"devDependencies":{"egg-bin":"^1.3.0","egg-ci":"^1.0.3","eslint":"^3.5.0","eslint-config-egg":"^3.1.0","mm":"^2.0.0","npminstall":"^2.2.2","pedding":"^1.0.0","should":"^11.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^2.0.1"},"gitHead":"463a77f5c155ee93d4f17437b8b7591d1451c022","_id":"tcp-base@1.0.1","_shasum":"8878c988c47606fd49da366b49e03ff2999f0035","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"dist":{"shasum":"8878c988c47606fd49da366b49e03ff2999f0035","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-1.0.1.tgz","integrity":"sha512-KHI47Kfvh5kl/XS78jP5HbtjooweXVPPJcRx3N9Bra+o9PKpGNuiIVBCSe7x47sPZTOS53x1Muv7hDiw7E6NsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCevMW0pjzoD9PM2oGbtUiV/JP70S5lQailWO2CNT195QIhAPOWL3x450EvvT8F1x9jYJfQ2iYa+uu260vlmiOZ83pg"}],"size":5244,"noattachment":false,"key":"/tcp-base/-/tcp-base-1.0.1.tgz"},"maintainers":[{"name":"coderhaoxin","email":"coderhaoxin@outlook.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"gxcsoccer","email":"gxcsoccer@126.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tcp-base-1.0.1.tgz_1476937892766_0.9244369487278163"},"directories":{},"publish_time":1476937893347,"_cnpm_publish_time":1476937893347},"1.0.0":{"name":"tcp-base","version":"1.0.0","description":"A base class for tcp client with basic functions","main":"lib/base.js","files":["lib"],"scripts":{"lint":"eslint --ext .js lib test example","test":"npm run lint && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/node-modules/tcp-base.git"},"keywords":["tcp"],"author":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"homepage":"https://github.com/node-modules/tcp-base#readme","engines":{"node":">= 4.0.0"},"ci":{"version":"4, 6"},"devDependencies":{"egg-bin":"^1.3.0","egg-ci":"^1.0.3","eslint":"^3.5.0","eslint-config-egg":"^3.1.0","mm":"^2.0.0","npminstall":"^2.2.2","pedding":"^1.0.0","should":"^11.1.0"},"dependencies":{"is-type-of":"^1.0.0","sdk-base":"^2.0.1"},"gitHead":"083fcafc32ad422a78d3970f0d0f58eed9f0257e","_id":"tcp-base@1.0.0","_shasum":"d71cb44ea6959c516be7a5aebe012753e93dad50","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"gxcsoccer","email":"gxcsoccer@126.com"},"maintainers":[{"name":"gxcsoccer","email":"gxcsoccer@126.com"}],"dist":{"shasum":"d71cb44ea6959c516be7a5aebe012753e93dad50","tarball":"http://registry-npm.ywwl.com/tcp-base/download/tcp-base-1.0.0.tgz","integrity":"sha512-4glsGBY3vDepmQv2cCif6QIJhNsYR6ZU90PeFhkSqy4bfzX6J/ziP3wY+SmGSM8GtMopjNxaahT0FT9tcp4eUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/mBplDcZtNyT/2N7FIgrOvBoZlKICJqJo7PAabHp/yQIgUxacZse0QrW86fYxCTZ/L+ZawNxTp2cCtzrhlLtBisw="}],"size":5202,"noattachment":false,"key":"/tcp-base/-/tcp-base-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/tcp-base-1.0.0.tgz_1474174335949_0.544915450969711"},"directories":{},"publish_time":1474174337842,"_cnpm_publish_time":1474174337842}},"readme":"# tcp-base\n\nA base class for tcp client with basic functions\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/node-modules/tcp-base/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/tcp-base/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/tcp-base.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/tcp-base\n[codecov-image]: https://codecov.io/gh/node-modules/tcp-base/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/node-modules/tcp-base\n[download-image]: https://img.shields.io/npm/dm/tcp-base.svg?style=flat-square\n[download-url]: https://npmjs.org/package/tcp-base\n\n## Install\n\n```bash\nnpm install tcp-base --save\n```\n\nNode.js >= 6.0.0 required\n\n## Usage\n\nA quick guide to implement a tcp echo client\n\nClient:\n\n```js\nconst TCPBase = require('tcp-base');\n\n/**\n * A Simple Protocol:\n *   (4B): request id\n *   (4B): body length\n *   ------------------------------\n *   body data\n */\nclass Client extends TCPBase {\n  getHeader() {\n    return this.read(8);\n  }\n\n  getBodyLength(header) {\n    return header.readInt32BE(4);\n  }\n\n  decode(body, header) {\n    return {\n      id: header.readInt32BE(0),\n      data: body,\n    };\n  }\n\n  // heartbeat packet\n  get heartBeatPacket() {\n    return Buffer.from([ 255, 255, 255, 255, 0, 0, 0, 0 ]);\n  }\n}\n\nconst client = new Client({\n  host: '127.0.0.1',\n  port: 8080,\n});\n\nconst body = Buffer.from('hello');\nconst data = Buffer.alloc(8 + body.length);\ndata.writeInt32BE(1, 0);\ndata.writeInt32BE(body.length, 4);\nbody.copy(data, 8, 0);\n\nclient.send({\n  id: 1,\n  data,\n  timeout: 5000,\n}, (err, res) => {\n  if (err) {\n    console.error(err);\n  }\n  console.log(res.toString()); // should echo 'hello'\n});\n```\n\nServer:\n\n```js\n'use strict';\n\nconst net = require('net');\n\nconst server = net.createServer(socket => {\n  let header;\n  let bodyLen;\n\n  function readPacket() {\n    if (bodyLen == null) {\n      header = socket.read(8);\n      if (!header) {\n        return false;\n      }\n      bodyLen = header.readInt32BE(4);\n    }\n\n    if (bodyLen === 0) {\n      socket.write(header);\n    } else {\n      const body = socket.read(bodyLen);\n      if (!body) {\n        return false;\n      }\n      socket.write(Buffer.concat([ header, body ]));\n    }\n    bodyLen = null;\n    return true;\n  }\n\n  socket.on('readable', () => {\n    try {\n      let remaining = false;\n      do {\n        remaining = readPacket();\n      }\n      while (remaining);\n    } catch (err) {\n      console.error(err);\n    }\n  });\n});\nserver.listen(8080);\n```\n\n[MIT](LICENSE)\n","_attachments":{},"homepage":"https://github.com/node-modules/tcp-base#readme","bugs":{"url":"https://github.com/node-modules/tcp-base/issues"},"license":"MIT"}