Use of deprecated NodeJS package in documentation
See original GitHub issueHi!
I was reviewing this page of the documentation https://questdb.io/docs/develop/query-data#http-rest-api, and just noticed the NodeJS example in the HTTP REST API section is using the querystring
package, which has been deprecated.
SOLUTION:
- Use the URLSearchParams built-in function
The NodeJS example could be something like this:
const fetch = require("node-fetch")
const HOST = "http://localhost:9000"
async function run() {
try {
const queryData = {query: "SELECT x FROM long_sequence(5);"}
const response = await fetch(`${HOST}/exec?${new URLSearchParams(queryData).toString()}`)
const json = await response.json()
console.log(json)
} catch (error) {
console.log(error)
}
}
run()
Thanks for your time!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Using deprecated packages - npm Docs
A deprecation message doesn't always mean the package or version is unusable; it may mean the package is unmaintained and will no longer...
Read more >NPM warn message about deprecated package - Stack Overflow
I got an answer for the similar question: https://stackoverflow.com/a/36335866/1115187. Briefly: npm outdated --depth=3. This command will analyze installed ...
Read more >Deprecated APIs | Node.js v19.2.0 Documentation
Deprecated APIs#. Node.js APIs might be deprecated for any of the following reasons: Use of the API is unsafe. An improved alternative API...
Read more >Your enterprise app is built on deprecated npm modules. or ?
The Node. js ecosystem has ballooned with transitive dependencies, and for the most part, they're an accepted part of the development landscape.
Read more >Node.js util.deprecate() Method - GeeksforGeeks
8.0_ method is an inbuilt application programming interface of the util module which wraps fn (which may be a function or class) in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing this one as it’s indeed resolved.
Hi @juancastellano115, good idea! If you wish, just open a PR in questdb.io repo, modifications should be applied to this file:
https://github.com/questdb/questdb.io/blob/4be28673dbea46c95445cdfe4304257e36362fcc/docs/develop/query-data.md?plain=1#L450-L472