multiavatar / Multiavatar

Multicultural Avatar Generator in JavaScript

Home Page:https://multiavatar.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publish on NPM

shadowtime2000 opened this issue · comments

Are you thinking about publishing the API on NPM in a format like CommonJS, UMD, or ES?

Yes, I'm planning to publish it on NPM, probably this weekend, in CommonJS format. I will post the link here when it's ready.

I have published it on npm: https://www.npmjs.com/package/@multiavatar/multiavatar

To install and use:
npm i @multiavatar/multiavatar

const multiavatar = require('@multiavatar/multiavatar')
let svgCode = multiavatar('Binx Bond')

Suggestions on how to improve the package are appreciated, as Node.js is not my native environment. I have tested it on a simple Node.js app, and it works well.

In the future, I'm planning to create different integrations for a variety of platforms. Contributions are also welcome.

@giekaton can you open source the actual package? Like with the package.json and stuff?

When installed with npm, the package.json appears in /node_modules/@multiavatar/multiavatar folder. But it is not a part of this github repo, as I made a separate package just for npm.

Do you mean to merge both packages, so that npm package would also be a part of this github repo?

@giekaton Yeah, I am talking about something like that, or making another repo for it, because then others can contribute to the package itself too.

Having it as a separate github repo is also an option, thanks for the suggestion. I will prepare it and let you know.

I have merged the npm package into this GitHub repository, as it is simpler to manage a single repo.

To prepare the package for npm: clone this repo, run npm run build, and then it can be published to npm.

Using the multiavatar.min.js from this repo, the build script creates the Node.js module (index.js) in the CommonJS format.