Wappler Extensibility - Custom Server Connect Module (node) - Binary Write File (Updated with encoding)

Introduction

Raised by sitestreet in the most recent meetup, it was identified as an omission from my recent extensions to have the ability to write text to a file.
So, as promised here it is

i have now updated this extension so the user can select the available encoding methods offered by node fs.

As it showed zero downloads, i have withdrawn the old npm and republished under a more suitable name and updated this tutorial

The NPM

How to Install

Module location

The Interface

Text to write to File.

This can be static text like this:
image

or a pointer to the output of an action. Here i use a "Read File Contents" action published previously:
image

Path to file

This can be a static path to the file lccation via :open_file_folder: or dynamic via the picker :zap:
Trailing slashes are optional as correct concatentation of path and file name is handled via the code

File name with extn

A valid file name with an extension

Encoding

Select the desired envcoding method (default is utf8)

Debug

Enables console messages

Output

The file is written and both a status and path are returned

t2f: {
status: 200,
path: "E:\webs\extension_repository\public\assets\files\testfile.txt"
}

Status 400 is returned in case if an error.

2 Likes

@Hyperbytes ... wow! you guys are way to clever... have you handed in your CV at the Wappler Head Office.... "Head of Cool Custom Sever Connect Modules".. think they have an opening... :slight_smile:

2 Likes

I only wish i was half as talented as those guys!

and I wish I was only half as talented as you :slight_smile: :slight_smile:

1 Like

Excellent work Brian. I just need to start a project in Node now so I can use all these great extensions! I'm still on PHP due to working on lots of projects which started many years ago.

I wonder if the 'Read from file' and 'Write to file' will be put into Wappler core as I feel this is a very core feature... and should be available to all server models. @George?

I'd be happy to create a feature request :slight_smile:

As they only use "Standard" functionality, php versions of these should be feasible,i'll add that to the list.

2 Likes

There is a 6-year old feature request for this already. I think other FRs - such as this one - are essentially the same request. I agree with you, it should be included in Wappler, rather than as an extension (with much appreciation of course for the great work of @Hyperbytes, and, in this case for @s.alpaslan who developed the first extension for this).

(It think it's such a fundamental requirement, it shouldn't really need a feature request.)

2 Likes

Thanks TomD for finding this.

I think this illustrates the growing problem with the structure of this forum. It is so packed with posts that finding relevant information is like looking for a needle in a haystack.
Clearly both myself and sitestreet were unaware of the extensions.

I was unaware/ had forgotten s.asplasan had done a php version (saves me some work) and reading through the post, i see Tobias also released a node version "Wappler-Node-JS-Extension---Create-Write-Append-File".

@tbvgl Are you still supporting this file management extension of is it now unsupported like the Wappler-redis-toolkit (mind if i look to take redis one over for support?)

1 Like

The file management extension is no longer supported. The Redis toolkit, on the other hand, will be re-released soon as part of a maintained (and paid) extension bundle. The private repo and licensing system are already set up, so it’s just a matter of time now.

Appreciate the interest — but the Redis toolkit and other upcoming extensions will be maintained and supported under my setup going forward.

2 Likes

What about support for those using it under the existing MIT licence?

1 Like

I think is why core functionality should be incorporated into Wappler. It's great that people create such useful extensions, but they can't always be expected to maintain/support them forever.

Without doubt it is a stop gap but in reality we know that FRs can go unresolved for years.
Look at the requests for things like a better editor than Summernote which is the editor from hell.
I guess i am a hopeless pragmatist rather than quixotic.

2 posts were split to a new topic: Wapplify marketplace