diff --git a/examples/readme-quickstart.ts b/examples/readme-quickstart.ts new file mode 100644 index 0000000..1af05bc --- /dev/null +++ b/examples/readme-quickstart.ts @@ -0,0 +1,16 @@ +// SPDX-FileCopyrightText: 2026 Xquik contributors +// +// SPDX-License-Identifier: Apache-2.0 + +import XTwitterScraper from 'x-twitter-scraper'; + +// Compile-only mirror of the README quickstart. It intentionally constructs +// the client and request params without sending a network request. +const client = new XTwitterScraper({ + apiKey: process.env['X_TWITTER_SCRAPER_API_KEY'], +}); + +const searchParams: XTwitterScraper.X.TweetSearchParams = { q: 'from:elonmusk', limit: 10 }; + +void client; +void searchParams; diff --git a/scripts/test b/scripts/test index 4981e8a..ffc8aad 100755 --- a/scripts/test +++ b/scripts/test @@ -8,6 +8,8 @@ set -e cd "$(dirname "$0")/.." +echo "==> Checking types" +./node_modules/typescript/bin/tsc --project tsconfig.json --noEmit echo "==> Running tests"