1.0.5 • Published 5 years ago

goo-avatar v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Image of goo-avatar

Create Server-Side avatars on the fly

GitHub npm GitHub pull requests GitHub contributors GitHub package.json dependency version (prod) GitHub top language

Getting Started


  npm install goo-avatar --save

ES6

    import gooAvatar from 'goo-avatar';

    gooAvatar.inSVG('User Name','destination/path').then(svg_path => {
        console.log(svg_path) //destination/path/21djde-2hdjd....svg
    }).catch(err => {
        console.log(err);
    });
    
    gooAvatar.inPNG('Company Name','destination/path').then(png_path => {
        console.log(png_path) //destination/path/21djde-2hdjd....png
    }).catch(err => {
        console.log(err);
    });

If a path is not specified, it creates a default avatar path

  gooAvatar.inPNG('Goo-Avatar').then(png_path =>{
    console.log(png_path) //avatar/2ieod-dkkd...png
  })
  .catch(err => console.log(err)});

Input


Type: String

The Input can be one of: A String. a path can also be sepcified in String

Output


Type: SVG, PNG, String

It returns a String specifying the path of the created avatar SVG or PNG

Example


  gooAvatar.inSVG('Goo-Avatar','destination/path').then(png_path =>{
    console.log(png_path); //destination/path/c1f9dcd0-4980-11e9-8537-231ee6fd230b.svg
  })
  .catch(err => console.log(err)});
  app.use(express.static("destination/path/"));
  <img src='destination/path/c1f9dcd0-4980-11e9-8537-231ee6fd230b.svg' style="width:100%;height:100%; border-radius:50%"/>

Example images

Conclusion


Thanks for supporting. Don't forget to share with others

Keywords


generate-avatar, create avatar, avatar, svg-avatar, goo-avatar

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago