tokyo_amesh_node_client
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

tokyo-amesh-nodejs-client

How to use

install

$ npm i tokyo_amesh_node_client

example (TypeScript)

import { AmeshClient, ImageSize } from "tokyo_amesh_node_client";

// The easiest way to get amesh image (as Jimp object).
AmeshClient.getLatestImage(ImageSize.Small)
    .then((img) => {
        console.log("Getting amesh image has been finished.");
        console.log(`width: ${img.bitmap.width}, height: ${img.bitmap.height}`);
    });

// You can also download an image as a file.
const fileName = "amesh.png";
AmeshClient.downloadLatestImage(ImageSize.Small, fileName)
    .then((img) => {
        console.log("Image has been downloaded.");
    });

// You can get mesh indecies.
const ameshClient = new AmeshClient();
ameshClient.getMeshIndices()
    .then((indices) => {
        console.log(indices);
    });

// Mesh indices looks like below.
[ '201708101315',
  '201708101310',
  '201708101305',
  '201708101300',
]

// You can get an image using specific mesh index.
ameshClient.getMeshIndices()
    .then((indices) => {
        return ameshClient.getImage(ImageSize.Small, indices[0]);
    })
    .then((img) => {
        console.log("Got an image.");
    });

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.3
    0
    • latest

Version History

Package Sidebar

Install

npm i tokyo_amesh_node_client

Weekly Downloads

0

Version

0.3.3

License

ISC

Unpacked Size

16.5 kB

Total Files

8

Last publish

Collaborators

  • satoyan