gm icon indicating copy to clipboard operation
gm copied to clipboard

Add a section about Typescript

Open cjonasw opened this issue 4 years ago • 2 comments

cjonasw avatar May 03 '21 00:05 cjonasw

I'm trying to use it like this:

import * as gmi from 'gm';

export class ImageService {

  findOne(imagePath: string) {
    gmi.(imagePath).identify(function (err, value) {
      console.log(value);
      if (err) {
        console.log(err);
      }
    });
    return `This action returns a #${imagePath} image`;
  }

But the result is:

TypeError: gmi is not a function

timofeysie avatar May 20 '22 23:05 timofeysie

Sorry for the consusion. import gm from 'gm'; does work.

timofeysie avatar May 21 '22 23:05 timofeysie