LoginSignup
13
8

LINE Notifyのnpmライブラリ作った

Last updated at Posted at 2019-11-28

はじめに

LINE Notify APIの Node.js ライブラリを作りました。
https://www.npmjs.com/package/line-notify-nodejs

使い方とサンプルソースを紹介します。

使用イメージ

Lwie2cZnxIv4eVYeEe9e1574930325-1574930375.gif

インストール

$ npm install line-notify-nodejs

使い方

簡単 2STEP です。

STEP1. トークンを発行する

下記ページからトークンを発行します。

image.png

image.png

image.png

STEP2. 通知を送信する

index.js
const lineNotify = require('line-notify-nodejs')('****************'; // 先ほどコピーしたトークン

await lineNotify.notify({
  message: 'send test',
});
console.log('send completed!');
$ npm run index.js

これで通知が送信されます!
Lwie2cZnxIv4eVYeEe9e1574930325-1574930375.gif

13
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
8