Is is possible to use Everything SDK from Nodejs?

Plug-in and third party software discussion.
Post Reply
defc
Posts: 15
Joined: Fri May 29, 2020 9:31 pm

Is is possible to use Everything SDK from Nodejs?

Post by defc »

I am a Nodejs developer and would like to use the SDK, since it can be used from Python, C# etc it shouldn't be hard but I haven't seen any examples etc.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is is possible to use Everything SDK from Nodejs?

Post by void »

I haven't tested this..

You'll need node-ffi or other library to load dlls in js.

Code: Select all

var ffi = require("ffi")
var ref = require("ref")

var everything = ffi.Library("./Everything32.dll", {
  'Everything_SetSearchW' : [ ref.types.void, [ref.types.CString]],
  'Everything_QueryW' : [ ref.types.uint, [ref.types.uint]],
  'Everything_GetNumResults' : [ ref.types.uint, [ref.types.void]],
})

Try calling:
everything.Everything_SetSearchW("txt");
-I'm not sure about using ref.types.CString for wchar_t
everything.Everything_QueryW(TRUE);
and see if everything.Everything_GetNumResults returns some results.
We can work from there..

https://github.com/node-ffi/node-ffi
https://github.com/node-ffi/node-ffi/wi ... I-Tutorial
https://github.com/node-ffi/node-ffi/issues/75
https://stackoverflow.com/questions/361 ... -using-ffi
defc
Posts: 15
Joined: Fri May 29, 2020 9:31 pm

Re: Is is possible to use Everything SDK from Nodejs?

Post by defc »

Thank you, thats very helpful. I will try this out as soon as I get some time. I've read on this forum that the SDK is not going to be as fast as the app itself, due to overhead of IPC, but we'll see.
void
Developer
Posts: 16748
Joined: Fri Oct 16, 2009 11:31 pm

Re: Is is possible to use Everything SDK from Nodejs?

Post by void »

Getting *all* results is slow over IPC.

Getting a page of results is just as fast as the Everything Search window.
You can use Everything_SetOffset and Everything_SetMax to limit your results to a page.
Post Reply