npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mingxingzhang/node-red-contrib-tcp-request2

v1.0.7

Published

node-red tcp request2

Downloads

26

Readme

node-red-contrib-tcp-request2

The official tcp request node of Node-RED has some problems:

If a fixed timeout is set, it will always wait for the same time (although the impact is not great); if a fixed data length is set, if the other party does not return the content, the connection will hang there.

Therefore, a maximum waiting length of x is needed. Within y seconds, if there is no return, a timeout will be reported. However, if x length is returned within y seconds, the waiting will end immediately and the content will be returned.

In addition, the splitc variable has two different meanings in the time and count modes respectively. I think they should be separated.

Different from the official tcp request node, tcp request2 has the following modifications:

  1. Retain the original logic based on time, characters, and length.
  2. socketTimeout can be set through the overtime parameter in the settings interface.
  3. server and port can be set through msg, global, flow, and env.
  4. The buffer length can be set manually under non-length-based TCP request methods.

Demo

  • Run npm start to start a demo flow with a tcp request node and a tcp in node. The tcp request node sends a request to the tcp in node, which returns a response.
  • The example is under examples/tcp_request2_demo.json. You can import it into your Node-RED instance.

Main differences to the official tcp request node

1. Settings

setup

2. Logical

With test tcp server like this:

test tpc server

timeout demo

when receive demo

after x demo

old demo

Development

  • Install dependencies using pnpm install -r
  • To run tests, execute pnpm test. To add tests, create a files <description>.spec.js with a mocha test specification.
  • Using changesets: Before committing a change that should be visible on the changelog run npx changeset and input the corresponding information into the wizard. Then add the created file in the .changeset folder to the commit.
  • Publishing: If not done yet, login to npm using npm login --registry=https://registry.npmjs.org --scope=@mingxingzhang. Then run npx changeset version to create a new version number, update package.json and the CHANGELOG.md files. Commit these changes with message Release VX.Y.Z. Then run ~~npx changeset publish~~ npm publish --access public to publish to npm. Now run git push --follow-tags to push the version tag created by changeset.
  • Validate the package(just once): npm run validate.