-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
Description
Once URL.searchParams has compability with more browsers, we can use this to simplify the _createURL function. At this moment, the function is supported by:
- Chrome ^51.0
- Firefox ^52.0
- Node ^7.5.0
The usage is pretty simple, example:
var url = new URL('https://www.alphavantage.co/query?');
var params = {
function: 'TIME_SERIES_INTRADAY',
symbol: 'MSFT',
interval: '1min',
apikey: 'demo'
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))For Node, all you need to do is add:
var URL = require('url').URL;