Giter VIP home page Giter VIP logo

alphavantage's People

Contributors

2pacisalive avatar akerra6993 avatar arizargaran avatar brunoquaresma avatar dependabot[bot] avatar freddyfy avatar greenkeeper[bot] avatar ianmitchell avatar jzatt avatar oacdesigns avatar ragnarpa avatar wejesuss avatar zackurben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alphavantage's Issues

fetching error

Hi, @zackurben @IanMitchell @jzatt
it might be me but i cant seem to make this work...
When i call :

<script>alpha.crypto.daily('btc', 'usd').then((data) => { console.log(data); }); </script>

I get error:
bundle.js:324 Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
at bundle.js:324:32
at Object.daily (bundle.js:371:18)
at (index):522:59
(anonymous) @ bundle.js:324
(anonymous) @ bundle.js:371
(anonymous) @ (index):522
Promise.then (async)
(anonymous) @ (index):522

I cant seem to figure it out, help please

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.14.3 to 1.15.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/prettier-1.15.0 at 100.0% (Details).

Release Notes for Prettier 1.15: HTML, Vue, Angular and MDX Support

🔗 Release Notes

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add Technical indicators data

I was looking to contribute by starting implementation of theTechnical Indicators endpoint
found at https://www.alphavantage.co/documentation/#technical-indicators.

This work includes some additional url parameters that may muddy up the current util.url() method that already exists.

My thought was to do a small re-factor to util.url that would only take the common queryString parameters across all endpoints (which looks to be function, symbol, and interval so far). Then each of the specialized endpoints (data, performance, indicators) could have helper methods that would append on their specific params?

From there, just follow the implementation from lib/data.js.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

An in-range update of dotenv is breaking the build 🚨

The dependency dotenv was updated from 6.1.0 to 6.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

dotenv is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

  • e1e7d57 6.2.0
  • 1eacd53 add support for preload configuration via env vars (#355)
  • 1f84ba1 add TypeScript types (#345)
  • 194c98e Fix appveyor repo badge url in readme (#347)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[feature] experimental for CSV request

Hi, thanks for this great job.
Experimental function make error with CSV result :

I try with :

alpha.experimental('LISTING_STATUS')

Error is :

FetchError: invalid json response body at https://www.alphavantage.co/query?apikey=XXX&function=LISTING_STATUS reason: Unexpected token s in JSON at position 0
    at /node_modules/cross-fetch/node_modules/node-fetch/lib/index.js:273:32
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid-json'
}

Question on how to get stock realtime data

First off all :)
Very interesting library i am using it for my new website .
Thank you soooooooo much for creating it.

I don't know how to get for example the latest price for example of NIO stock

const nioPrice = await alpha.data.intraday(nio);

for example this returns me a big object with intraday prices , i just need the latest ...

@zackurben

SyntaxError: Cannot use import statement outside a module

node_modules/alphavantage/index.js:3
import Util from './lib/util';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:881:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
at Module.load (internal/modules/cjs/loader.js:798:32)
at Function.Module._load (internal/modules/cjs/loader.js:711:12)
at Module.require (internal/modules/cjs/loader.js:838:19)
at require (internal/modules/cjs/helpers.js:74:18)

Polished date (ISO string) can have incorrect timezone offset applied

On time series data returned from the API, the util.polish() routine may apply an incorrect timezone offset to the date time string when compared to the data["Meta Data"]["6. Time Zone"] attribute returned in the raw data.

Example

Tested on v2.3.0

Raw Response
Notice the time zone is US/Eastern and that means the series key is 18th at 8pm Eastern time

{
    "Meta Data": {
        "1. Information": "Intraday (30min) open, high, low, close prices and volume",
        "2. Symbol": "MSFT",
        "3. Last Refreshed": "2022-07-18 20:00:00",
        "4. Interval": "30min",
        "5. Output Size": "Full size",
        "6. Time Zone": "US/Eastern"
    },
    "Time Series (30min)": {
        "2022-07-18 20:00:00": {
            "1. open": "254.6000",
            "2. high": "255.2000",
            "3. low": "254.6000",
            "4. close": "255.0200",
            "5. volume": "7262"
        },
...
}

Polished Response
Notice the series key is 18th at 7pm with a Zulu zone, or UTC. This will mean a 5 hour difference to the correct time of the data point.

{
    "meta": {
        "information": "Intraday (30min) open, high, low, close prices and volume",
        "symbol": "MSFT",
        "updated": "2022-07-18 20:00:00",
        "interval": "30min",
        "size": "Full size",
        "zone": "US/Eastern"
    },
    "Time Series (30min)": {
        "2022-07-18T19:00:00.000Z": {
            "open": "254.6000",
            "high": "255.2000",
            "low": "254.6000",
            "close": "255.0200",
            "volume": "7262"
        },
...
}

Ideally the ISO string should contain the offset to UTC, e.g. 2022-07-18T20:00:00.000-04:00, so it can be correctly parsed.

Testing code

const alpha = require('alphavantage')({ key: 'mykey' });

alpha.data.intraday("MSFT", "full", "json", "30min").then((data) => {
    console.log(`data: ${JSON.stringify(data, null, 4)}`);

    console.log(`polish: ${JSON.stringify(alpha.util.polish(data), null, 4)}`);
}).catch((e) => {
    console.log(`e ${JSON.stringify(e, null, 4)}`)
})

Looking for way to interface this with a vue/nuxtjs app

Looking for way to interface this with a vue/nuxtjs app.

I keep hitting this problem where I'm not able to import alphavantage through plugins... Was wondering if there was something wrong with package.json? Thanks!

ERROR in ./node_modules/alphavantage/node_modules/dotenv/lib/main.js
Module not found: Error: Can't resolve 'fs' in '/Users/XXXXX/Projects/myApp/myApp/node_modules/alphavantage/node_modules/dotenv/lib'
ERROR in ./node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/Users/XXXXX/Projects/myApp/myApp/node_modules/request/lib'
/** plugins/alphavantage.js
 * Init Alpha Vantage with your API key.
 *
 * @param {String} key
 *   Your Alpha Vantage API key.
 */
import AlphaVantage from 'alphavantage'
import Vue from 'vue'
const alpha = AlphaVantage({
  key: '0ZC3SK0K7V1R4UZZ'
})

Vue.use(alpha)

Improve compiler to export Typescript interfaces

Hi all,

I'm working on a typescript project using this nice alphavantage lib. And would be nice to have access to all param and return types.

Would be nice that this ones were exported aswell.
// https://www.alphavantage.co/documentation/#dailyadj interface RawStockDailyAdjusted { 'Meta Data': { '1. Information': string; '2. Symbol': string; '3. Last Refreshed': string; '4. Output Size': string; '5. Time Zone': string; }; 'Time Series (Daily)': { [date: string]: | { '1. open': string; '2. high': string; '3. low': string; '4. close': string; '5. adjusted close': string; '6. volume': string; '7. dividend amount': string; '8. split coefficient': string; } | undefined; }; }

Also would be nice to have this interface improved in terms of replacing the T with the correct interfaces

intraday: <T = any>(symbol: string, outputsize?: string, datatype?: string, interval?: string) => Promise<T>; daily: <T = any>(symbol: string, outputsize?: string, datatype?: string, interval?: string) => Promise<T>; daily_adjusted: ( symbol: string, outputsize?: string, datatype?: string, interval?: string ) => Promise<RawStockDailyAdjusted>;

An in-range update of request-promise-native is breaking the build 🚨

The dependency request-promise-native was updated from 1.0.5 to 1.0.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

request-promise-native is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/request-promise-native-1.0.6 at 100.0% (Details).

Commits

The new version differs by 10 commits.

  • 7ad655a Version 1.0.6 (now really)
  • 1240b80 fix: updated indirect lodash dependency to fix security vulnerability
  • 80947a1 Version 1.0.6
  • ad529a3 chore: fix ci build for node v8+
  • c2c54c4 Merge pull request #33 from jasonmit/u/jasonmit/fix-node-6
  • 67f7ed2 Merge branch 'master' into u/jasonmit/fix-node-6
  • 4633d4c fix: breaking change in tough-cookie v3
  • 14aa6ee chore: added node 8 and 10 to ci build
  • 9cfcaaa Update package.json
  • 049152b fix: target tough-cookie 2.x to preserve node 6 support

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of coveralls is breaking the build 🚨

The devDependency coveralls was updated from 3.0.2 to 3.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/coveralls-3.0.3 at 100.0% (Details).

Release Notes for Dependency security updates

As suggested by NPM and Snyk.

Commits

The new version differs by 1 commits.

  • aa2519c dependency security audit fixes from npm & snyk (#210)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Implement SMA-like technical indicators

Using the base technical indicator sma from #18, finish implementing the following indicators with test coverage:

  • EMA
  • WMA
  • DEMA
  • TEMA
  • TRIMA
  • KAMA
  • T3
  • RSI
  • MOM
  • CMO
  • ROC
  • ROCR
  • TRIX
  • MIDPOINT

An in-range update of prettier is breaking the build 🚨

Version 1.7.1 of prettier just got published.

Branch Build failing 🚨
Dependency prettier
Current Version 1.7.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

[feature] CRYPTO_INTRADAY

Hi and thanks for this job.

I have the impression that intraday crypto is not supported.

alpha.cryto.intraday

does not exist.

Add Typescript Type definitions

Type definitions for each of the functions available.

Data structure returned when calling the functions.
Data structure when fetched data is polished alpha.util.polish

An in-range update of webpack is breaking the build 🚨

The devDependency webpack was updated from 4.41.4 to 4.41.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/webpack-4.41.5 at 100.0% (Details).

Release Notes for v4.41.5

Bugfixes

  • handle relative paths with webpack:// prefix in SourceMaps correctly
  • fixes a non-determinism about providedExports with export * which caused changing module hashes and unnecessary HMR invalidation
Commits

The new version differs by 7 commits.

  • 45ecebc 4.41.5
  • 8a0dac1 Merge pull request #10185 from webpack/bugfix/non-deterministic-provided-exports
  • 4e31587 Merge pull request #10183 from webpack/deps/update
  • 3ec952f update dependencies in-range
  • 8e4749e make order of exports in providedExports deterministic
  • 0e5e8d9 Merge pull request #10181 from webpack/backport/webpack-source-map-prefix
  • 6b9884e handle webpack:// prefix in SourceMap sources

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Obsolete interval parameter for all except intraday

Hi,

Thanks for providing a JS wrapper around the API.

You are saying that your API calls for time series are like this:

alpha.data.intraday(symbol, outputsize, datatype, interval);
alpha.data.daily(symbol, outputsize, datatype, interval);
alpha.data.daily_adjusted(symbol, outputsize, datatype, interval);
alpha.data.weekly(symbol, outputsize, datatype, interval);
alpha.data.weekly_adjusted(symbol, outputsize, datatype, interval);
alpha.data.monthly(symbol, outputsize, datatype, interval);
alpha.data.monthly_adjusted(symbol, outputsize, datatype, interval);
alpha.data.quote(symbol, outputsize, datatype, interval);

But the fact is the only intraday support interval parameter. The rest of the calls the internal is obsolete (and even an invalid request).

You could clean-up your API? And update your docs plz?
This is only very confusing for people.

Regards,
Melroy van den Berg

An in-range update of jest is breaking the build 🚨

Version 21.1.0 of jest just got published.

Branch Build failing 🚨
Dependency jest
Current Version 21.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As jest is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
  • coverage/coveralls First build on greenkeeper/jest-21.1.0 at 100.0% Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of prettier is breaking the build 🚨

Version 1.7.0 of prettier just got published.

Branch Build failing 🚨
Dependency prettier
Current Version 1.6.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes 1.7.0: JSX tweaks, Pragma, TypeScript and CSS fixes

image

This release features some bugfixes and tweaks around JSX, TypeScript, CSS, and JavaScript formatting, as well as a couple new features.

Highlights

JSX Changes

We received a lot of community feedback about the changes we made to JSX formatting in the 1.6.0 release, and have made changes to bring formatting closer to community standards and expectations.

In 1.6.0, we added a second style for ternaries (conditional expressions, a ? b : c), based on a format popular in the community where parentheses are used to demarcate JSX content:

const DinnerOptions = ({ willEatMeat, willEatEggs, willEatVegetables }) => (
  <div>
    <div>Let's get some dinner...</div>
    {willEatMeat ? (
      <FullMenu />
    ) : willEatEggs ? (
      <VegetarianMenu />
    ) : willEatVegetables ? (
      <VeganMenu />
    ) : (
      <BackupMenu />
    )}
  </div>
);

Before this was added, prettier only formatted ternaries with one consistent style:

willEatMeat
  ? "Full Menu"
  : willEatEggs
    ? "Vegetarian Menu"
    : willEatVegetables ? "Vegan Menu" : "Backup Menu";

In 1.6.0, we used the following heuristic to decide when to use the new "JSX mode ternaries":

We should print a ternary using JSX mode if:
  * The ternary contains some JSX in it
  OR
  * The ternary appears inside of some JSX

However, this heuristic caused some unexpected formatting:
Github Diff showing a ternary containing internationalization strings appearing inside a JSX element being converted to use JSX-mode style ternaries

So, in 1.7.0, we have revised our heuristic to just be:

We should print a ternary using JSX mode if:
  * The ternary contains some JSX in it

We hope that this change will result in fewer surprising ternaries.

A big thanks goes out to @duailibe who implemented this change in addition to several other JSX-related formatting issues that were reported.

CSS Letter Case Consistency

We spent some time this release polishing our CSS formatting, and as part of that, @lydell did some work to normalize letter case.

So now, almost everything in CSS will print using lower case.

/* Before */
DIV.Foo {
  HEIGHT: 12PX;
}

/ After /
div.Foo {
height: 12px;
}

Don't worry, though – Prettier won't touch your $scss-variables, @less-variables, or FunctionNames(). Preprocess on!

Pragma Support

There is a new option called --require-pragma (requirePragma via the API) which will change prettier's behavior so that it only reformats a file if it has a special "pragma" comment at the top of it, that looks like this:

/**
 * @prettier
 */

or

/**
 * @format
 */

This was @ajhyndman's idea and it was implemented by @wbinnssmith.

Other Changes

TypeScript

There was a bug in Prettier 1.6.1 where an error would be thrown while parsing any TypeScript using the never type, for example:

Observable.empty<never>();

Also, Prettier 1.6.1 was incorrectly removing the declare keyword from enum declarations in *.d.ts files:

// In
declare const enum Foo {}

// Out
const enum Foo {}

Both of these issues have been fixed. Thanks to @JamesHenry and @existentialism for these fixes which support our TypeScript community!

Configuration

Configurable Config Precedence

There is a new CLI option --config-precedence which configures how prettier should prioritize config sources. Valid values are:

cli-override (default) - CLI options take precedence over config file

file-override - Config file take precedence over CLI options

prefer-file - If a config file is found will evaluate it and ignore other CLI options. If no config file is found CLI options will evaluate as normal.

This option adds support to editor integrations where users define their default configuration but want to respect project specific configuration.

prettier.resolveConfig.sync

Previously, there was no way via the API to resolve configuration for a source file synchronously. Thanks to some new additions to cosmiconfig by @sudo-suhas, @ikatyang was able to add support for this to the prettier API.

PRs merged in this release

Issues resolved in this release


Thank you to everyone who contributed to this release, be it through issue creation, code contribution, code review, or general commenting and feedback. Prettier is a community-run project and is able to continue to exist thanks to people like you. Thank you!

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Missing `dotenv` dependency?

Hey, thanks for creating this module. :) It works great for my purposes, but when I first installed it via npm install alphavantage I couldn't require('alphavantage') until I also manually ran npm install dotenv. I think because your package.json file uses index.js as main and index.js requires dotenv, shouldn't dotenv be in dependencies in package.json instead of devDependencies?

(Documentation) Interval parameter is incorrectly shown

In the docs, it shows this for an intraday request with an interval:

alpha.data.intraday(symbol, interval)

However, the following doesn't work (interval is still set to 1min):

alpha.data.intraday(symbol, '5min')

This does, however:

alpha.data.intraday(symbol, 'compact', 'json', '5min');

Perhaps a config object would make more sense here, and/or updating the docs to be clearer about this?

Also, thanks for this great library!

An in-range update of coveralls is breaking the build 🚨

The devDependency coveralls was updated from 3.0.4 to 3.0.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 6 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

unable to import polished data interfaces [typescript]

I am unable to use the typescript interfaces for polished data (namely StockQuote, StockDailyAdjusted, and StockSearch) because they aren't exported from the namespace.

Adding an export before each of these will allow them to be used properly as the generic type <T> when calling the util.polish() function
e.g.

import Alphavantage from "alphavantage"
const alpha = Alphavantage({key: 'api_key'});

// ...
const polishedData = alpha.util.polish<Alphavantage.StockQuote>(rawData);

Real time data - subscribe

Hi, if I'm looking to get real-time data on specific time intervals like 1 min, does this package take care of the subscription to the API or I will have to implement ?

How to change Time Zone in Alpha Vantage API

Can I change the time zone in the result from Alpha Vantage API? Here is an example of the output. It's currently in EST. I'd like to get it in IST.

'Meta Data': {
'1. Information': 'Intraday (1min) open, high, low, close prices and volume',
'2. Symbol': 'BSE:------',
'3. Last Refreshed': '2019-11-01',
'4. Output Size': 'Compact',
'5. Time Zone': 'US/Eastern
}

'Time Series (1min)': {
'2019-11-01 00:08:59': {
'1. open': '70.7500',
'2. high': '70.7500',
'3. low': '70.7500',
'4. close': '70.7500',
'5. volume': '0'
},

How To

I need a detailed code on how to use quotes because I keep getting a promise pending or if I use the .then function data is non existing. The Documentation on Alpha is not that great can anyone help?

An in-range update of coveralls is breaking the build 🚨

The devDependency coveralls was updated from 3.0.6 to 3.0.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/coveralls-3.0.7 at 100.0% (Details).

Commits

The new version differs by 1 commits.

  • 2ed185c added support for GitLab Merge Request IID

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Query multiple symbol

Hi, can it query multiple symbol in one time?

symbols= ["IBM", "MSFT", "APPL"]
alpha.experimental('EARNINGS', {
  symbols
}).then(data => {})

An in-range update of request is breaking the build 🚨

Version 2.82.0 of request just got published.

Branch Build failing 🚨
Dependency request
Current Version 2.81.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

request is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 27 commits.

  • 0ab5c36 2.82.0
  • ffdf0d3 Updating deps.
  • 4386836 Merge branch 'master' of github.com:request/request
  • 1527407 Merge pull request #2703 from ryysud/add-nodejs-v8-to-travis
  • 3afcbf8 Merge branch 'master' of github.com:request/request
  • 479143d Update of hawk and qs to latest version (#2751)
  • 169be11 Add Node.js v8 to Travis CI
  • 643c43a Fixed some text in README.md (#2658)
  • e8fca51 chore(package): update aws-sign2 to version 0.7.0 (#2635)
  • e999203 Update README to simplify & update convenience methods (#2641)
  • 6f286c8 lint fix, PR from pre-standard was merged with passing tests
  • a765593 Add convenience method for HTTP OPTIONS (#2541)
  • 52d6945 Add promise support section to README (#2605)
  • b12a624 refactor(lint): replace eslint with standard (#2579)
  • 29a0b17 Merge pull request #2598 from request/greenkeeper-codecov-2.0.2

There are 27 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of request is breaking the build 🚨

Version 2.83.0 of request just got published.

Branch Build failing 🚨
Dependency request
Current Version 2.82.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

request is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.7.7 to 7.8.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/monorepo.babel7-20200114023911 at 100.0% (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of prettier is breaking the build 🚨

Version 1.6.0 of prettier just got published.

Branch Build failing 🚨
Dependency prettier
Current Version 1.5.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • coverage/coveralls Coverage pending from Coveralls.io Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes 1.6.0: Config File, JSX

image

I want to give a special shout out to @azz who has been maintaining the repository and implementing a bunch of the changes in this release as I had less time to devote to prettier due to vacation and switching team :)

Highlights

Configuration

Implement cosmiconfig for workspace configuration (#2434) by @azz

Since the very first release of prettier, people have asked for a .prettierrc file. We've been trying to have as few options as possible and tried to avoid being one more .dotfile that you have to have when starting a new project.

But, the truth is, we need to have some way to configure prettier that can be kept in sync with all the integrations. By not having one, we pushed the problem to them and saw a bunch of incompatible ways of handling the problem. So now, it's handled by prettier itself.

// .prettierrc
{
  "trailingComma": "es5",
  "singleQuote": true
}

For more information on configuration file support, see the README.

Support .prettierignore files (#2412) by @evilebottnawi

Along with telling what configuration to use, you can write a file .prettierignore to tell which files not to convert.

# .prettierignore
dist/
package.json

JSX

Improve JSX Formatting (#2398) by @suchipi

The last big friction point from people trying to adopt prettier was around how JSX was being printed. We went through all the issues that were raised and made a bunch of changes:

  • Arrow Function Expressions returning JSX will now add parens when the JSX breaks
// Before
const Component = props =>
  <div>
    Hello {props.name}!
  </div>;

// After
const Component = props => (
<div>
Hello {props.name}!
</div>
);

  • Conditional expressions within (or containing) JSX are formatted in a different way using parenthesis
// Before
<div>
  {props.isVisible
    ? <BaseForm
        url="/auth/google"
        method="GET"
      />
    : <Placeholder />}
</div>;

// After
<div>
{props.isVisible ? (
<BaseForm
url="/auth/google"
method="GET"
/>
) : (
<Placeholder />
)}
</div>

  • JSX in logical expressions (|| or &&) is always wrapped in parens when the JSX breaks
// Before
<div>
  {props.isVisible &&
    <BaseForm
      url="/auth/google"
      method="GET"
    />}
</div>;

// After
<div>
{props.isVisible && (
<BaseForm
url="/auth/google"
method="GET"
/>
)}
</div>

Hopefully this is going to be more in line with how the majority of the community is writing JSX and we can have prettier be used in more place ;)

Inline single expressions in JSX (#2442) by @karl

With JSX, we started by respecting a lot of line breaks that were in the original source. This had the advantage of doing fewer changes to your codebase but chipped away the value of a consistent pretty printer as the same semantic code could be written in two ways.

During each new release we've tightened this and made decisions around how to always print a piece of code. The latest of those is what happens if there's a single child in a JSX object, we're now always going to inline it.

// Before
return (
  <div>
    {this.props.test}
  </div>
);
return <div>{this.props.test}</div>;

// After
return <div>{this.props.test}</div>;
return <div>{this.props.test}</div>;

Ensure there is a line break after leading JSX white space (#2348) by @karl

Leading JSX empty spaces are now on their own line. It looked weird to have them before a tag as it "indented" it differently compared to the rest.

// Before
<span className="d1">
  {' '}<a
    href="https://github.schibsted.io/finn/troika"
    className="link"
  />
</span>

// After
<span className="d1">
{' '}
<a
href="https://github.schibsted.io/finn/troika"
className="link"
/>
</span>

Other Changes

JSON

Use babylon.parseExpression for JSON (#2476) by @josephfrazier

We used to use a strict JSON parser that would throw if there was a comment or a trailing comma. This was inconvenient as many JSON files in practice are parsed using JavaScript or json5 that are not as strict. Now, we have relaxed this and are using the JavaScript parser to parse and print JSON. This means that comments will be maintained if there were some.

Note that this is purely additive, if your original file was JSON compliant, it will keep printing a valid JSON.

// Before
Syntax error

// After
{ / some comment / "a": 1 }

JavaScript

Add more supervisory parens (#2423) by @azz

Parenthesis are a hot topic because they are not part of the AST, so prettier ignores all the ones you are putting and re-creating them from scratch. We went through all the things that people reported and came up with a few edge cases that were very confusing when comparisons were chained and % was mixed with * or /.

One thing that we are not changing is the fact that we remove extra parenthesis around combinations of basic arithmetic operators: +-*/.

// Before
x !== y === z;
x * y % z;

// After
(x !== y) === z;
(x * y) % z;

Implement prettier-ignore inside JSX (#2487) by @azz

It's useful to be able to ignore pieces of JSX, it's now possible to add a comment inside of a JSX expression to ignore the formatting of the next element.

// Before
<Component>
  {/*prettier-ignore*/}
  <span ugly format="" />
</Component>

// Before
<Component>
{/prettier-ignore/}
<span ugly format='' />
</Component>

Do not swallow prettier-ignore comments (#2664)

In order to support some edge cases, in the internals, we have the ability to avoid printing comments in a generic way and print them in the call site instead. It turns out that when we used prettier-ignore, we didn't print the comments at all! This is now fixed.

// Before
push(
  <td> :)
  </td>,
);

// After
push(
// prettier-ignore
<td> :)
</td>,
);

Fix indentation of a do-while condition (#2359) by @jsnajdr

It took 6 months for someone to report that do-while were broken when the while condition is multi-line, it confirms my hunch that this construct is not widely used in practice.

// Before
do {} while (
  someVeryLongFunc(
  someVeryLongArgA,
  someVeryLongArgB,
  someVeryLongArgC
)
);

// After
do {} while (
someVeryLongFunc(
someVeryLongArgA,
someVeryLongArgB,
someVeryLongArgC
)
);

Break sequence expressions (#2388) by @bakkot

Another underused feature of JavaScript is sequence expressions. We used to do a bad job at printing them when they would go multi-line, this has been corrected :)

// Before
(a = b ? c : "lllllllllllllllllllllll"), (a = b
  ? c
  : "lllllllllllllllllllllll"), (a = b ? c : "lllllllllllllllllllllll"), (a = b
  ? c
  : "lllllllllllllllllllllll"), (a = b ? c : "lllllllllllllllllllllll");

// After
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll')

Trim trailing whitespace from comments (#2494) by @azz

We took the stance with prettier to remove all the trailing whitespaces. We used to not touch comments because it's user generated, but that doesn't mean that they should have whitespace :)

// Before
// There is some space here ->______________

// After
// There is some space here ->

Fix interleaved comments in class decorators (#2660, #2661)

Our handling for comments inside of the class declaration was very naive, we would just move all the comments to the top. We now are more precise and respect the comments that are interleaved inside of decorators and around extends.

// Before
// A
// B
// C
@Foo()
@Bar()
class Bar {}

// After
// A
@Foo()
// B
@Bar()
// C
class Bar {}

Improve bind expression formatting (#2493) by @azz

Bind expressions are being discussed at TC39 and we figured we could print it with prettier. We used to be very naive about it and just chain it. Now, we use the same logic as we have for method chaining with the . operator for it. We also fixed some edge cases where it would output invalid code.

// Before
observable::filter(data => data.someTest)::throttle(() =>
  interval(10)::take(1)::takeUntil(observable::filter(data => someOtherTest))
)::map(someFunction);

// After
observable
::filter(data => data.someTest)
::throttle(() =>
interval(10)::take(1)::takeUntil(observable::filter(data => someOtherTest))
)
::map(someFunction);

Add support for printing optional catch binding (#2570) by @existentialism

It's being discussed at TC39 to be able to make the argument of a catch(e) optional. Let's make sure we can support it in prettier if people use it.

// Before
Syntax error

// After
try {} catch {}

Add support for printing optional chaining syntax (#2572) by @azz

Another new proposal being discussed at TC39 is an optional chaining syntax. This is currently a stage 1 proposal, so the syntax may change at any time.

obj?.prop       // optional static property access
obj?.[expr]     // optional dynamic property access
func?.(...args) // optional function or method call

Handle Closure Compiler type cast syntax correctly (#2484) by @yangsu

Comments are tricky to get right, but especially when they have meaning based on where they are positioned. We're now special casing the way we deal with comments used as type cast for Closure Compiler such that they keep having the same semantics.

// Before
let assignment /** @type {string} */ = getValue();

// After
let assignment = /** @type {string} */ (getValue());

Inline first computed property lookup in member chain (#2670) by @azz

It looks kind of odd to have a computed property lookup on the next line, so we added a special case to inline it.

// Before
data
  [key]('foo')
  .then(() => console.log('bar'))
  .catch(() => console.log('baz'));

// After
data[key]('foo')
.then(() => console.log('bar'))
.catch(() => console.log('baz'));

Flow

Support opaque types and export star (#2543, #2542) by @existentialism

The flow team introduced two very exciting features under a new syntax. We now support them in prettier. I've personally been waiting for opaque types for a veerrryyyy long time!

// Before
Syntax error

// After
opaque type ID = string;
export type * from "module";

Strip away unnecessary quotes in keys in type objects and interfaces (#2643)

We've been doing this on JavaScript objects since the early days of prettier but forgot to apply the same thing to Flow and TypeScript types.

// Before
type A = {
  "string": "A";
}

// After
type A = {
string: "A";
}

Print TypeParameter even when unary function type (#2406) by @danwang

Oopsy, we were dropping the generic in this very specific case.

// Before
type myFunction = A => B;

// After
type myFunction = <T>(A) => B;

Keep parens around FunctionTypeAnnotation inside ArrayTypeAnnotation (#2561) by @azz

Parenthesis... someday we'll get all of them fixed :)

// Before
const actionArray: () => void[] = [];

// After
const actionArray: (() => void)[] = [];

TypeScript

Support TypeScript 2.5 RC (#2672) by @azz

TypeScript 2.5 RC was recently announced, allowing you to use the upcoming "optional catch binding" syntax in TypeScript, too. 🎉

Don't add namespace keyword to global declaration (#2329) by @azz

// Before
namespace global {
  export namespace JSX {  }
}

// After
global {
export namespace JSX {}
}

Fix <this.Component /> (#2472) by @backus

Thanks to the untyped and permissive nature of JavaScript, we've been able to concat undefined to a string and get some interesting code as a result. Now fixed for this case :)

// Before
<undefined.Author />

// After
<this.Author />

Allow type assertions to hug (#2439) by @azz

We want to make sure that all the special cases that we added for JavaScript and Flow also work for TypeScript constructs. In this case, objects should also hug if they are wrapped in a as operator.

// Before
const state = JSON.stringify(
  {
    next: window.location.href,
    nonce,
  } as State
);

// After
const state = JSON.stringify({
next: window.location.href,
nonce,
} as State);

Remove parens for type assertions in binary expressions (#2419) by @azz

Most of the time we add parenthesis for correctness but in this case, we added them for nothing, so we can just get rid of them and have a cleaner code :)

// Before
(<x>a) || {};

// After
<x>a || {};

Print parens around type assertion as LHS in assignment (#2525) by @azz

Yet another case of missing parenthesis. Thankfully we're getting very few of them nowadays and they are for extremely rare edge cases.

// Before
foo.bar as Baz = [bar];

// After
(foo.bar as Baz) = [bar];

Print declare for TSInterfaceDeclaration (#2574) by @existentialism

The declare keyword doesn't do anything for interface so we never put it there. However, it felt weird if you were in a declaration file and seeing everything have declare before it except for interfaces. So now we reprint declare if it was there in the first place.

// Before
interface Dictionary<T> {
  [index: string]: T
}

// After
declare interface Dictionary<T> {
[index: string]: T
}

CSS

Normalize quotes in CSS (#2624) by @lydell

In order to get a first version of CSS to ship, we kept string quotes as is. We are now respecting the singleQuote option of prettier. The difficulty here was to make sure that we output correct code for all the crazy escapes, unicode characters, emoji, special rules like charset which only work with double quotes...

// Before
div {
  content: "abc";
}

// After
div {
content: 'abc';
}

Normalize numbers in CSS (#2627) by @lydell

Another place where we can reuse the logic we've done for JavaScript to improve CSS printing.

// Before
border: 1px solid rgba(0., 0.0, .0, .3);

// After
border: 1px solid rgba(0, 0, 0, 0.3);

Quote unquoted CSS attribute values in selectors (#2644) by @lydell

I can never quite remember the rules behind quotes around attributes so we're now always putting quotes there.

// Before
a[id=test] {}

// After
a[id="test"] {}

Add support for css keyword (#2337) by @zanza00

// Before
const header = css`.top-bar {background: black;margin: 0;position: fixed;}`

// After
const header = css</span></span> <span class="pl-s"> .top-bar {</span> <span class="pl-s"> background: black;</span> <span class="pl-s"> margin: 0;</span> <span class="pl-s"> position: fixed;</span> <span class="pl-s"> }</span> <span class="pl-s"><span class="pl-pds">;

Support styled-components with existing component (#2552, #2619) by @azz

styled-components has a lot of different variants for tagging template literals as CSS. It's not ideal that we've got to encode all those ways inside of prettier but since we started, might as well do it for real.

styled(ExistingComponent)`
  css: property;
`;

styled.button.attr({})</span></span> <span class="pl-s"> border: rebeccapurple;</span> <span class="pl-s"><span class="pl-pds">;

Trim whitespace in descendant combinator (#2411) by @azz

The CSS parsers we use do not give us a 100% semantic tree: in many occasions they bail and just give us what is being entered. It's up to us to make sure we clean this up while maintaining correctness. In this case, we just printed spaces between selectors as is but we know it's correct to always replace it by a single space.

// Before
.hello
        .<span class="pl-smi">how</span><span class="pl-k">-</span>you<span class="pl-k">-</span>doin {

height: 42;
}

// After
.hello .how-you-doin {
height: 42;
}

Strip BOM before parsing (#2373) by @azz

I still have nightmares from dealing with BOM in a previous life. Thankfully, in 2017 it's no longer a big issue as most tooling is now aware of it. Thanks @azz for fixing an edge cases related to CSS parsing.

// Before
[BOM]/* Block comment *
html {
  content: "#{1}";  
}
// After
[BOM]/* Block comment */
html {
  content: "#{1}";  
}

GraphQL

Add support for range-formatting GraphQL (#2319) by @josephfrazier

If you tried to use the range formatting feature in a GraphQL file, it would throw an exception, now it properly worked again and only reformats the piece you selected.

Add .gql file extension to be parsed as GraphQL (#2357) by @rrdelaney

At Facebook, we use .graphql extension but it looks like it's common to have .gql as well, doesn't cost a lot to support it in the heuristic that figures out what parser to use.

CLI

Support multiple patterns with ignore pattern (#2356) by @evilebottnawi

It was already possible to have multiple glob patterns but they would be additive, with this change, you can add a glob pattern to ignore some files. It should be very handy to ignore folders that are deeply nested.

prettier --write '{**/*,*}.{js,jsx,json}' '!vendor/**'

Make --list-different to work with --stdin (#2393) by @josephfrazier

This is a handy way of knowing if prettier would print a piece of code in a different way. We already had all the concepts in place, we just needed to wire them up correctly.

$ echo 'call ( ) ;' | prettier --list-different
(stdin)
$ echo $?
1
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.14.2 to 1.14.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/prettier-1.14.3 at 100.0% (Details).

Release Notes for 1.14.3

🔗 Changelog

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.