omrilotan / isbot

🤖/👨‍🦰 Detect bots/crawlers/spiders using the user agent string
https://isbot.js.org/
The Unlicense
933 stars 77 forks source link

Add "spawn" interface #155

Closed omrilotan closed 3 years ago

omrilotan commented 3 years ago

Created an internal class. Since the default exports is a function, which is backwards compatible, and also very simple for out-of-the-box use, I've added a "spawn" wrapper function, similar to "extend", "exclude" and "find".

Releasing this as a release candidate so I can test it in different environments before we continue to a public release.

Testing release candidate:

npm i isbot@spawn

Resolve #153

richardscarrott commented 3 years ago

@omrilotan thanks for looking into this!

I like the idea of being able to 'spawn' child instances, reminds me of pino logger and seems like a good way to keep the interface the same 👍

omrilotan commented 3 years ago

Thank you for this input, @richardscarrott I've been running this version in production and performance-wise it appears to have no implications. I'm ready to release this version as is (3.3.0) on Monday. If you want to experiment with it (isbot@3.3.0-rc.2) in the meantime and let me know if you have anything else to say about the interface or implementation.