| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
serpapi-javascript is developed using Deno. Refer to https://deno.land/manual/getting_started/installation to install Deno.
Ensure you're running at least Deno v1.46.3.
deno --version
deno upgrade # to upgrade to the latest versionInstall the appropriate extension for your preferred editor/IDE: https://deno.land/manual/getting_started/setup_your_environment. The extension "integrates directly to the Deno CLI using the language server protocol. This helps ensure that the information you get about your code aligns to how that code will work when you try to run it under the Deno CLI."1
If you use VSCode, use the following settings (.vscode/settings.json):
{
"deno.enablePaths": [
"mod.ts",
"version.ts",
"src",
"tests/*.ts",
"tests/engines/",
"scripts",
"examples/deno"
],
"deno.inlayHints.enumMemberValues.enabled": false,
"deno.inlayHints.functionLikeReturnTypes.enabled": false,
"deno.inlayHints.parameterNames.enabled": "none",
"deno.inlayHints.parameterTypes.enabled": false,
"deno.inlayHints.propertyDeclarationTypes.enabled": false,
"deno.inlayHints.variableTypes.enabled": false,
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
}
}Subsequently, install the vscode_deno extension and you're good to go.
SERPAPI_TEST_KEY=YOUR_API_KEY
it("getJson with api key from config", {
ignore: !HAS_API_KEY,
}, async () => {
...
});deno task test # Run tests
deno task test:watch # Run tests and in watch mode: https://deno.land/manual/getting_started/command_line_interface#watch-mode
deno task test:cov # Get test coverage by running testsTo run examples on your local source files, follow these steps.
{
"dependencies": {
"dotenv": "*",
"serpapi": "../../../npm"
},
"scripts": {
"start": "node basic_example.js"
}
}These test key functionality on different Node.js versions. They are ran on GitHub Actions, see the build workflow for more details.
To run these locally, follow these steps.
deno task docs:genTypeScript types are generated from the backend code. Follow these steps to update the types.
Once you've done the above, create a pull request with a clear description. SerpApi project members will then review the request.
| Back | FazBrowse Home | New Git URL |