Table of Contents
This is the classical lower-case example from the
node-red documentation but converted from Javascript to
TypeScript.
But why Typescript? Many, many reasons, for instance did you know that the
original code contains a bug in that it assumes unconditionally that msg
contains a payload member and that it is always a string? By using Typescript
the compiler and IDE are able to pick up that and give you an error:
and by fixing that not only does the compiler stop complaining "Hey, the type of payload is unknown, you cannot assume it exists or that it is a string", but now it also is able to safely provide suggestions on which methods a string variable has and you might be interested in using:
So while having a lower-case capable node is perhaps by it self not that super exciting, the idea is that you should be able to use this project as a template/starting point to develop your awesome Node-RED node, in Typescript.
- Fork this repository.
- Make whatever modifications you want.
- Run tests.
- Profit?
- Wait for pull request to support ESM to be merged and then update to ESM.
- Publish on NPM (pending esm support).
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Notice that wip/* branches are work in progress and can be rebased at any time.
While the documentation page does not explicitly say, the repository says Apache 2.0. But that covers the lowercase code. When you remove that code to replace it with your own code feel free to change the license of your new project to something else, including LGPL.
Project Link: https://github.com/hlovdal/hlovdal-node-red-lowercase-in-typescript

