dougwithseismic / npm-definitely-not-a-robot

A Puppeteer Browser that acts like a human. For when you really, really, REALLY need to prove you are definitely not a robot.
15 stars 8 forks source link

Typo: `import definitelyNotAHuman` and other confusion in the readme? #2

Open ggorlen opened 6 months ago

ggorlen commented 6 months ago

From the readme:

import definitelyNotAHuman from 'path-to-definitely-not-a-robot'

const browser = new definitelyNotAHuman()

Why would we want to call this variable "definitely not a human" (i.e., a robot)? Shouldn't this be import definitelyNotARobot from 'path-to-definitely-not-a-robot'?

Also, path-to-definitely-not-a-robot is usually the actual package name.


I realize that

Be a human pretending to be a robot being a human robot human-being

is an attempt at humor, but it's very confusing. I suggest just stating what the library does simply.

eng3 commented 6 months ago

Does the name matter? Regardless, more detailed instructions would be helpful for beginners like myself. It sounds like you are extending puppeteer so this is meant to drop in to replace it.

ggorlen commented 6 months ago

@eng3 Yes, it matters. I'm not extending Puppeteer, I'm just trying to answer your stack overflow question, but I wasn't able to easily determine what the library does or understand how to install/import it.

Beyond the name, the convention is to capitalize constructors, so I'd suggest new DefinitelyNotARobot().

Now that you mention it, extending Puppeteer is the correct way to design a package like this. Hiding browser.launch() as this library does makes it more or less unusable, because being able to specify launch options is a critical piece of functionality that needs to be exposed. It seems to be--my mistake.

dougwithseismic commented 6 months ago

Fwiw I think, but can't remember, that I made it possible to swap your own Puppeteer instance in - If I didn't then I definitely should have.

Again, I'll get to this next week - apologies for the delay, I'm without a machine ✌️

On Tue, 12 Mar 2024, 18:29 ggorlen, @.***> wrote:

@eng3 https://github.com/eng3 Yes, it matters. I'm not extending Puppeteer, I'm just trying to answer your stack overflow question https://stackoverflow.com/questions/78148272/how-can-i-use-typescript-code-in-an-existing-node-project, but I wasn't able to easily determine what the library does or understand how to install/import it.

Now that you mention it, extending Puppeteer is the correct way to design a package like this. Hiding browser.launch() as this library does makes it more or less unusable, because being able to specify launch options is a critical piece of functionality that needs to be exposed.

— Reply to this email directly, view it on GitHub https://github.com/dougwithseismic/npm-definitely-not-a-robot/issues/2#issuecomment-1992074785, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALSIKRBXXDGWNN64HV2EN23YX4UPVAVCNFSM6AAAAABESP3KBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSGA3TINZYGU . You are receiving this because you are subscribed to this thread.Message ID: @.*** .com>

eng3 commented 6 months ago

@ggorlen I wasnt sure how to install/import it either hence why I asked the question. As for the broader question of why anyone needs this package at all, I don't know. I'm running out of ideas thus thought something like this was worth a try. I didn't want to list the site by name in order to attempt to keep some anonymity due to the nature of this type of thing