Giter Club home page Giter Club logo

megalodon's Introduction

Megalodon

Test NPM Version GitHub release npm NPM

Megalodon is a Fediverse API client library for NodeJS and browsers. This library allows for interfacing with Mastodon, Pleroma, Friendica, and Firefish servers all with the same interface, providing REST API and streaming methods.

The Rust version is megalodon-rs.

Supports

  • Mastodon Mastodon
  • Pleroma Pleroma
  • Friendica
  • Firefish Firefish
  • Gotosocial
  • Akkoma (Unofficial)

Features

  • REST API
  • Admin API
  • WebSocket for streaming
  • Promisified methods
  • NodeJS and browser support
  • Written in TypeScript

Install

# npm
npm install -S megalodon

# pnpm
pnpm add megalodon

# yarn
yarn add megalodon

Usage

There are code examples, abd please refer to the documentation about each method.

I explain some typical methods. At first, please get your access token for a fediverse server. If you don't have access token, or you want to register applications and get access token programmably, please refer Authorization section.

Home timeline

import generator, { Entity, Response } from 'megalodon'

const BASE_URL: string = 'https://mastodon.social'
const access_token: string = '...'

const client = generator('mastodon', BASE_URL, access_token)
client.getHomeTimeline()
  .then((res: Response<Array<Entity.Status>>) => {
    console.log(res.data)
  })

Make a post

import generator, { Entity, Response } from 'megalodon'

const BASE_URL: string = 'https://mastodon.social'
const access_token: string = '...'
const post: string = 'test post'

const client = generator('mastodon', BASE_URL, access_token)
client.postStatus(post)
  .then((res: Response<Entity.Status>) => {
    console.log(res.data)
  })

Post media

Please provide a file to the argument.

import generator, { Entity, Response } from 'megalodon'
import fs from 'fs'

const BASE_URL: string = 'https://mastodon.social'
const access_token: string = '...'
const image = fs.readFileSync("test-image.png")

const client = generator('mastodon', BASE_URL, access_token)
client.uploadMedia(image)
  .then((res: Response<Entity.Attachment>) => {
    console.log(res.data)
  })

WebSocket streaming

import generator, { Entity } from 'megalodon'

const BASE_URL: string = 'https://pleroma.io'
const access_token: string = '...'

const client = generator('pleroma', BASE_URL, access_token)
client.userStreaming().then(stream => {
  stream.on('connect', () => {
    console.log('connect')
  })

  stream.on('update', (status: Entity.Status) => {
    console.log(status)
  })

  stream.on('notification', (notification: Entity.Notification) => {
    console.log(notification)
  })

  stream.on('delete', (id: number) => {
    console.log(id)
  })

  stream.on('error', (err: Error) => {
    console.error(err)
  })

  stream.on('heartbeat', () => {
    console.log('thump.')
  })

  stream.on('close', () => {
    console.log('close')
  })

  stream.on('parser-error', (err: Error) => {
    console.error(err)
  })
})

Authorization

You can register applications and/or get access tokens to use this method.

import generator, { OAuth } from 'megalodon'

const BASE_URL: string = 'https://mastodon.social'

let clientId: string
let clientSecret: string

const client = generator('mastodon', BASE_URL)

client.registerApp('Test App')
  .then(appData => {
    clientId = appData.client_id
    clientSecret = appData.client_secret
    console.log('Authorization URL is generated.')
    console.log(appData.url)
  })

Please open Authorization URL in your browser, and authorize this app. In this time, you can get authorization code.

After that, get an access token.

const code = '...' // Authorization code

client.fetchAccessToken(clientId, clientSecret, code)
  .then((tokenData: OAuth.TokenData) => {
    console.log(tokenData.access_token)
    console.log(tokenData.refresh_token)
  })
  .catch((err: Error) => console.error(err))

Detect each server's software

You have to provide the server's software name (e.g. mastodon, pleroma, firefish) to the generator function. But when you only know the URL and not the software the server runs on, the detector function can detect the server's software.

import { detector } from 'megalodon'

const FIRST_URL = 'https://mastodon.social'
const SECOND_URL = 'https://firefish.social'

const first_server = await detector(MASTODON_URL)
const second_server = await detector(FIREFISH_URL)

console.log(first_server) // mastodon
console.log(second_server) // firefish

License

The software is available as open source under the terms of the MIT License.

megalodon's People

Contributors

cpluspatch avatar dastardlylemon avatar dependabot-preview[bot] avatar dependabot[bot] avatar dermike avatar fasiha avatar godsenal avatar h3poteto avatar kphrx avatar mirror-kt avatar mogita avatar potproject avatar renovate[bot] avatar samtherapy avatar teabroker avatar thatonecalculator avatar urmaul avatar vyrcossont avatar yonie 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

megalodon's Issues

uploadMedia uses FormData internally that does not exist in node

Hi there,

Been playing with this neat npm package, thanks! However, when I attempt to use client.uploadMedia, I can see in the source it uses "new FormData()" internally. FormData does not exist in node, except if I add FormData = require('form-data'); to my js file.

Note that I'm not using TypeScript, just plain vanilla JS. Without the additional added package, it crashes. Should be a dependency!

Furthermore, after that's fixed, I consistently get a "400 Bad Request" at the /api/v1/media endpoint when trying to upload media on my Pleroma instance. Does this mean it's another bug or am I doing something else wrong?
postStatus() works well: the toot is visible.

Thanks!

Question about authentication

I can’t figure out how registerApp with a random name ‘TestApp’ and url e.g. mastodon.social in any way relates to my personal account when getting clientId, clientSecret, authorizationCode. Is there another authentication flow where I provide username / password, before I can make this call? The app-related pages in Mastodon docs are missing. Any explanation appreciated: How does this work?

Prepare all methods to call API endpoints

Now we provide only http methods, e.q. get, post, put, delete ....

But I want to use this library more easily. So please provide each methods to call APIs, like:

  • getHomeTimeline
  • getPublicTimeline
  • postToot
    ...

Misskey returns plain content

But megalodon treats content as html text. So please transfer plain text to html text, and store plain content for another column.

Unhandled exception when close connection

The exception has occur, after I stop the server when I run streaming with websocekt.

[2019-12-16 01:13:39.877] [error] Error: WebSocket was closed before the connection was established
    at WebSocket.close (/opt/Whalebird/resources/app.asar/node_modules/ws/lib/websocket.js:219:14)
    at WebSocket._resetConnection (/opt/Whalebird/resources/app.asar/node_modules/megalodon/lib/src/web_socket.js:65:26)
    at WebSocket.stop (/opt/Whalebird/resources/app.asar/node_modules/megalodon/lib/src/web_socket.js:60:14)
    at e.stop (/opt/Whalebird/resources/app.asar/dist/electron/main.js:1:28962)
    at EventEmitter.<anonymous> (/opt/Whalebird/resources/app.asar/dist/electron/main.js:1:53683)
    at EventEmitter.emit (events.js:200:13)
    at WebContents.<anonymous> (/opt/Whalebird/resources/electron.asar/browser/api/web-contents.js:335:21)
    at WebContents.emit (events.js:200:13)

Support status notification

refs: h3poteto/whalebird-desktop#2088

Sample notification data:

{
  account: {
    id: '1874',
    username: 'h3poteto',
    acct: '[email protected]',
    display_name: 'h3poteto',
    locked: false,
    bot: false,
    discoverable: false,
    group: false,
    created_at: '2019-08-18T04:23:00.039Z',
    note: `Administrator of pleroma.io.<br><br>I'm a software engineer working in Japan. I'm developing Whalebird which is a Mastodon client for desktop.<br><a href="https://whalebird.org" rel="nofollow noopener noreferrer" target="_blank">https://whalebird.org</a><br><a href="https://github.com/h3poteto" rel="nofollow noopener noreferrer" target="_blank">https://github.com/h3poteto</a>`,
    url: 'https://pleroma.io/users/h3poteto',
    avatar: 'https://s3.fedibird.com/cache/accounts/avatars/000/001/874/original/55d066a645cb8f2d.png',
    avatar_static: 'https://s3.fedibird.com/cache/accounts/avatars/000/001/874/original/55d066a645cb8f2d.png',
    header: 'https://s3.fedibird.com/accounts/headers/000/001/874/original/d541a8003fc52084.jpeg',
    header_static: 'https://s3.fedibird.com/accounts/headers/000/001/874/original/d541a8003fc52084.jpeg',
    followers_count: 419,
    following_count: 342,
    subscribing_count: 0,
    statuses_count: 6149,
    last_status_at: '2021-02-28',
    emojis: [],
    fields: []
  },
  created_at: '2021-02-28T16:15:41.505Z',
  id: '3050983',
  status: {
    id: '105809768496257462',
    uri: 'https://pleroma.io/objects/d1df1d7f-00e9-410f-aa80-4168a7ae3a7b',
    url: 'https://pleroma.io/objects/d1df1d7f-00e9-410f-aa80-4168a7ae3a7b',
    account: {
      id: '1874',
      username: 'h3poteto',
      acct: '[email protected]',
      display_name: 'h3poteto',
      locked: false,
      bot: false,
      discoverable: false,
      group: false,
      created_at: '2019-08-18T04:23:00.039Z',
      note: `Administrator of pleroma.io.<br><br>I'm a software engineer working in Japan. I'm developing Whalebird which is a Mastodon client for desktop.<br><a href="https://whalebird.org" rel="nofollow noopener noreferrer" target="_blank">https://whalebird.org</a><br><a href="https://github.com/h3poteto" rel="nofollow noopener noreferrer" target="_blank">https://github.com/h3poteto</a>`,
      url: 'https://pleroma.io/users/h3poteto',
      avatar: 'https://s3.fedibird.com/cache/accounts/avatars/000/001/874/original/55d066a645cb8f2d.png',
      avatar_static: 'https://s3.fedibird.com/cache/accounts/avatars/000/001/874/original/55d066a645cb8f2d.png',
      header: 'https://s3.fedibird.com/accounts/headers/000/001/874/original/d541a8003fc52084.jpeg',
      header_static: 'https://s3.fedibird.com/accounts/headers/000/001/874/original/d541a8003fc52084.jpeg',
      followers_count: 419,
      following_count: 342,
      subscribing_count: 0,
      statuses_count: 6149,
      last_status_at: '2021-02-28',
      emojis: [],
      fields: []
    },
    in_reply_to_id: null,
    in_reply_to_account_id: null,
    reblog: null,
    content: 'いつのまにか3月じゃん',
    created_at: '2021-02-28T16:15:34.162Z',
    emojis: [],
    replies_count: 0,
    reblogs_count: 0,
    favourites_count: 0,
    reblogged: false,
    favourited: false,
    muted: false,
    sensitive: false,
    spoiler_text: '',
    visibility: 'public',
    media_attachments: [],
    mentions: [],
    tags: [],
    card: null,
    poll: null,
    application: null,
    language: 'ja',
    pinned: undefined,
    emoji_reactions: [],
    bookmarked: false,
    quote: false
  },
  type: 'status'
}

This event is received as notification, not update event.

Drop Moment?

Checking out some Mastodon libraries, and this one caught my eye. Looks good!

One question though: would you consider dropping Moment? Right now, this adds 200KB+ to the bundle...

Use-case: would love to run this in a constrained environment (Web, Deno, etc.), and moment adds a lot of unnecessary bloat.

There's also Luxon, which adds 60KB.

A quick scan of the source shows that you're only using Moment in one place. In that case, I'd argue it isn't worth 200KB :-)

README is out-of-date and unnecessarily complicated

As the title says, the README page needs to be updated.

Due to a recent(?) update to Mastodon, there is now a much simpler way of getting the access token directly through the web interface so the section "Authorization" seems obsolete. I've been able to build a very minimalistic Node script just by adapting the section "Post Toot", skipping the earlier sections.

Your package is a lot easier to use than the README suggests. You should update it to reflect that.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /example/javascript/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

View the update logs.

Can not parse delete event

Sometimes I receive delete event, but megalodon can not parse it.

  [22:07:59.204] [error] Error: Error parsing websocket reply: {"event":"delete","payload":"9iXBSXHXQfkDAQiJhA"}, error message: SyntaxError: Unexpected token i in JSON at position 1
      at Parser.parser (/home/akira/src/github.com/h3poteto/whalebird-desktop/node_modules/megalodon/lib/web_socket.js:169:32)
      at WebSocketConnection.<anonymous> (/home/akira/src/github.com/h3poteto/whalebird-desktop/node_modules/megalodon/lib/web_socket.js:103:30)
      at WebSocketConnection.emit (events.js:182:13)
      at WebSocketConnection.processFrame (/home/akira/src/github.com/h3poteto/whalebird-desktop/node_modules/websocket/lib/WebSocketConnection.js:554:26)
      at /home/akira/src/github.com/h3poteto/whalebird-desktop/node_modules/websocket/lib/WebSocketConnection.js:323:40
      at process._tickCallback (internal/process/next_tick.js:61:11)

The payload is a string, but megalodon parse the payload as JSON: https://github.com/h3poteto/megalodon/blob/master/src/web_socket.ts#L206
So, it is failed.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current JavaScript dependencies. It had expected to find one at the path: /example/javascript/package.json.

If this isn't a JavaScript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

View the update logs.

Auto reconnect when does not receive any message for a certain period

refs: h3poteto/whalebird-desktop#1034

Now megalodon is implemented auto reconnect, but this function is called after close event.
On other hand, sometimes could not receive message from mastodon server without close events.

I can reproduce it to use VPN server.

  1. Start Whalebird and it starts streaming
  2. Connect or disconnect VPN server
  3. The streaming does not receive any message, but I can post statuses

Therefore, it is require to reconnect when does not receive any message for a while.

Add Mastodon 'conversation' event

mastodon/mastodon#8832

This event currently triggers a stacktrace in Megalodon.

┏ Electron -------------------

  [23:27:17.006] [error] Error: Unknown event has received: [object Object]
      at Parser.parser (/Users/amalia/Desktop/whalebird/node_modules/megalodon/lib/web_socket.js:157:40)
      at WebSocketConnection.<anonymous> (/Users/amalia/Desktop/whalebird/node_modules/megalodon/lib/web_socket.js:101:30)
      at WebSocketConnection.emit (events.js:182:13)
      at WebSocketConnection.processFrame (/Users/amalia/Desktop/whalebird/node_modules/websocket/lib/WebSocketConnection.js:554:26)
      at /Users/amalia/Desktop/whalebird/node_modules/websocket/lib/WebSocketConnection.js:323:40
      at process._tickCallback (internal/process/next_tick.js:61:11)
  
  
┗ ----------------------------

(Also, the event's contents are not printed as part of the stacktrace.)

Add function to detect SNS

generator can return megalodon instance if we specify SNS name, but now I can't detect SNS name from API.

Poll notification is not vote event, it is expire event

In Mastodon, notification are not published when the poll is voted. Poll event are received when the poll response expires.
On the other hand, In Misskey, notification are published when the poll is voted.

At the moment, Megalodon treat poll notification as poll vote event, but it is mistake. Please divide poll vote and poll expires event.

API document

I have added JSDoc comments, but there is no API document.

Update relationship object

Now mastodon returns following response as relationship

{"id":"1874","following":true,"delivery_following":true,"showing_reblogs":true,"notifying":true,"followed_by":true,"account_subscribing":{},"blocking":false,"blocked_by":false,"muting":false,"muting_notifications":false,"requested":false,"domain_blocking":false,"endorsed":false,"note":""}

So update relationship. I want to add notifying option.

Megalodon's WebSocket reconnects already closed sockets

During debug of h3poteto/whalebird#553, I found out that if a websocket instance is stopped,

this._socketConnection.close()

if an error happens during the connection closure it is not only leaked to the caller, it also triggers a reconnection:

megalodon/src/web_socket.ts

Lines 130 to 138 in 0a80a51

conn.on('close', (code) => {
// Refer the code: https://tools.ietf.org/html/rfc6455#section-7.4
if (code === 1000) {
this.emit('close', {})
} else {
console.log(`Closed connection with ${code}`)
this._reconnect(cli)
}
})

This means that the socket is left in a sort of 'zombie' state. It is still connected and emitting events; and if the caller removes the event handlers (like Whalebird does), the next error in the socket will trigger an uncaughtException.

Megalodon object fails to instantiate in React builds

Originally noted from hyperspacedev/hyperspace-classic#1:

Note: this might be more related to Hyperspace itself than to all React apps.

Megalodon objects instantiate and function normally in a React app when running react-scripts start. However, when running react-scripts test or react-scripts build and then serving the built content, the instantiation fails.

In Hyperspace, the following error occurs:

TypeError: "n is undefined"
	t App.js:26
Ii16React	448 index.js:7
	f (index):1
	184 main.b0bd95cd.chunk.js:1
	f (index):1
	a (index):1
	e (index):1
	<anonymous> main.b0bd95cd.chunk.js:1
 react-dom.production.min.js:3869
ya16React	448 index.js:7
	f (index):1
	184 main.b0bd95cd.chunk.js:1
	f (index):1
	a (index):1
	e (index):1
	<anonymous> main.b0bd95cd.chunk.js:1

Steps to reproduce

  1. In the App component, create a constructor and field for the client:
class App extends Component {
    client;
    constructor(props) {
        super(props);
        this.client = new Mastodon(accesstoken, baseurl + '/api/v1');
    }
}
  1. Use that client for a task (say, passing it down to a ComposeWindow element):
<App>
    <ComposeWindow client={this.client}/>
</App>

Unable to send multipart/form-data (image) to /media endpoint

I keep getting HTTP/400 feedback from the API when client.post()-ing to /api/v1/media.

I'm using FormData to create the formData object that get's submitted to the API.
Upon looking into the sourcecode (generated JS), I noticed that the content-type never gets set to multipart/formdata.

You think this could be related?

Proxy support for rest and websocket

Some countries are blocked from some server, so user could not connect the server directly. The user have to use proxy server.

refs: h3poteto/whalebird-desktop#982

TODO

  • REST API
  • Streaming
  • WebSocket

Checklist

  • Connect to https mastodon server through http proxy without authentication
  • Connect to https pleroma server through http proxy without authentication
  • Connect to https mastodon server through socks proxy without authentication
  • Connect to https pleroma server through socks proxy without authentication

Error when receive pollVote event in Misskey

When I received this event, an error has occur.

  17:38:14.136 › Error: Unknown event has received: {"id":"d03f0bbf-0156-4dd9-8a4b-ed828d28ba94","type":"unreadNotification","body":{"id":"8jmh29glxn","createdAt":"2021-03-21T08:38:12.069Z","type":"pollVote","isRead":false,"userId":"7rl99pkppb","user":{"id":"7rl99pkppb","name":"h3poteto","username":"h3poteto","host":"pleroma.io","avatarUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fpleroma.io%2Fmedia%2F0dc2c5ad4b8416469a14570d7f2ccbf74c87b26a46ecd3728b0731bee763be9a.blob&thumbnail=1","avatarBlurhash":"yNKC000[0F;]r==qXUEUr;r;kXofjYWBI^rqxBT0WAW?n$0;$xxuwZocOGRkIrxYjES$bbV@ofXUaengW?oIayoL9xxY$}NHR*bdsl","avatarColor":null,"instance":{"name":"Pleroma.io","softwareName":"pleroma","softwareVersion":"2.2.2-0-g837ace170","iconUrl":"https://pleroma.io/favicon.png","faviconUrl":"https://pleroma.io/favicon.png","themeColor":null},"emojis":[]},"note":{"id":"8jmh1r18mb","createdAt":"2021-03-21T08:37:48.188Z","userId":"81u70uwsja","user":{"id":"81u70uwsja","name":"h3poteto :linux:","username":"h3poteto","host":null,"avatarUrl":"https://s3.arkjp.net/misskey/thumbnail-63807d97-20ca-40ba-9493-179aa48065c1.png","avatarBlurhash":null,"avatarColor":null,"emojis":[{"name":"linux","host":null,"url":"https://s3.arkjp.net/misskey/9241877d-1d82-48f4-bfa3-e48fb510b14c.png","aliases":[""]}]},"text":"またてすと","cw":null,"visibility":"public","renoteCount":0,"repliesCount":0,"reactions":{},"emojis":[],"fileIds":[],"files":[],"replyId":null,"renoteId":null,"poll":{"multiple":false,"expiresAt":null,"choices":[{"text":"hoge","votes":0,"isVoted":false},{"text":"fuga","votes":1,"isVoted":false}]}},"choice":1}}
      at Parser.parse (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/megalodon/lib/src/misskey/web_socket.js:300:36)
      at WebSocket.<anonymous> (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/megalodon/lib/src/misskey/web_socket.js:201:26)
      at WebSocket.emit (events.js:315:20)
      at Receiver.receiverOnMessage (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/ws/lib/websocket.js:797:20)
      at Receiver.emit (events.js:315:20)
      at Receiver.dataMessage (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/ws/lib/receiver.js:437:14)
      at Receiver.getData (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/ws/lib/receiver.js:367:17)
      at Receiver.startLoop (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/ws/lib/receiver.js:143:22)
      at Receiver._write (/home/h3poteto/src/github.com/h3poteto/whalebird-desktop/node_modules/ws/lib/receiver.js:78:10)
      at writeOrBuffer (internal/streams/writable.js:358:12)

Could not update axios

$ node dist/pleroma/favourite.js 
(node:161103) UnhandledPromiseRejectionWarning: TypeError: config.cancelToken.subscribe is not a function
    at dispatchHttpRequest (/home/h3poteto/src/github.com/h3poteto/megalodon/node_modules/axios/lib/adapters/http.js:347:48)
    at new Promise (<anonymous>)
    at httpAdapter (/home/h3poteto/src/github.com/h3poteto/megalodon/node_modules/axios/lib/adapters/http.js:48:10)
    at dispatchRequest (/home/h3poteto/src/github.com/h3poteto/megalodon/node_modules/axios/lib/core/dispatchRequest.js:58:10)
    at Axios.request (/home/h3poteto/src/github.com/h3poteto/megalodon/node_modules/axios/lib/core/Axios.js:108:15)
    at Axios.<computed> [as get] (/home/h3poteto/src/github.com/h3poteto/megalodon/node_modules/axios/lib/core/Axios.js:129:17)
    at Function.wrap [as get] (/home/h3poteto/src/github.com/h3poteto/megalodon/node_modules/axios/lib/helpers/bind.js:9:15)
    at Client.<anonymous> (/home/h3poteto/src/github.com/h3poteto/megalodon/megalodon/lib/src/pleroma/api_client.js:262:30)
    at step (/home/h3poteto/src/github.com/h3poteto/megalodon/megalodon/lib/src/pleroma/api_client.js:33:23)
    at Object.next (/home/h3poteto/src/github.com/h3poteto/megalodon/megalodon/lib/src/pleroma/api_client.js:14:53)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:161103) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:161103) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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.