Closed ptommasi closed 3 years ago
Thanks for spotting it!
Btw, it might be also worth mentioning that - since your project is in TypeScript - using this style of import:
import { Solver } from "2captcha";
const solver = new Solver(<...>);
Instead of:
const Captcha = require("2captcha")
const solver = new Captcha.Solver(<...>);
Will enable typings on your objects! Might be worth to put it somewhere in your doc that you support TypeScript, it's just free brownie points! (Unless I got something wrong, or actually that import doesn't work, because I didn't have a chance to try it).
To my understanding, if 'types' is specified in the package.json, The IDE will by default use the typescript for all associated functions / types, regardless of how you actually import the package. I'm targeting ES2019 with my JavaScript in non-module mode, so all import statements get compiled down to require
imports in the resulting JS files.
In the readme I specified it was require based import because the readme was just a JS example, and this lib is (likely) used far more for JS projects then TS projects. But thanks for the idea! I'll put a note in the readme clarifying that you can use import
statements for it as well ^^
In the base64 example, "solver" is "Solver" (there is a misspell on the first s, it should be capital)