
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
connection-parse
Advanced tools
Simple TCP connection string parser, and nothing more then that. It simply
transforms 1.1.1.1:1111
in to a simple parsed object. I seem to do this a lot
in most of my modules such as hashring, memcached and failover. So it makes
sense to extract this in to a small util.
Install this module using npm
:
npm install connection-parse --save
The --save
automatically adds the package and version to your package.json
.
var parse = require('connection-parse');
parse('1.1.1.1:1111')
parse('1.1.1.1:1111', '1.3.3.4:1345');
parse(['1.1.1.1:1111', '1.3.3.4:1345']);
parse({ '1.1.1.1:1111': 100 });
{
servers: [{
string: '1.1.1.1:1111',
host: '1.1.1.1',
port: 1111
}],
regular: ['1.1.1.1:1111'],
weighted: {
'1.1.1.1:1111': 100 // or 1 by default
}
}
// It also accepts custom parsers
parse.merge(function (data) {
data.foo = 'bar';
return data;
});
Then the server instances will also have an extra property, `foo`.
MIT
0.0.7
FAQs
Simple TCP connection string parser
The npm package connection-parse receives a total of 178,431 weekly downloads. As such, connection-parse popularity was classified as popular.
We found that connection-parse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.