aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.95k stars 615 forks source link

Add a section about Typescript #827

Open cjonasw opened 3 years ago

timofeysie commented 2 years ago

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 commented 2 years ago

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