Is is possible to use Everything SDK from Nodejs?

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

Is is possible to use Everything SDK from Nodejs?

Post by defc » Sun May 31, 2020 6:38 pm

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
Site Admin
Posts: 5652
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void » Mon Jun 01, 2020 2:06 am

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: 8
Joined: Fri May 29, 2020 9:31 pm

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

Post by defc » Mon Jun 01, 2020 11:13 pm

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
Site Admin
Posts: 5652
Joined: Fri Oct 16, 2009 11:31 pm

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

Post by void » Mon Jun 01, 2020 11:17 pm

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