question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use of deprecated NodeJS package in documentation

See original GitHub issue

Hi!

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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
puzpuzpuzcommented, Sep 28, 2022

Closing this one as it’s indeed resolved.

1reaction
hezeancommented, Jun 27, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found