Search code examples
angularfontsnpmglyph

Publish font through npm for use in project


I've created a set of music glyphs (notes, dotted notes, and time signatures) for use in a web-application I'm currently developing using angular2, as I wasn't able to find a font with glyphs I felt were appropriate for the application. My hierarchy for the font is as follows

  • fonts
    • notes.eot
    • notes.svg
    • notes.ttf
    • notes.woff
  • package.json (from npm init)
  • readme.txt
  • selection.json (from npm init)
  • style.css

I'm now not sure what steps I need to take from here to publish this into npm (I'm happy to share these glyph sets through npm), and I haven't been able to find an article or StackOverflow answer that helps me. I would appreciate a list of steps to publish and use these glyphsets in my project.


Solution

  • The npm publish command will publish the entire npm-managed directory, based on the version tag you have in your package.json so protip: do your versioning using the npm version major, npm version minor, and npm version patch commands, don't manually bump them. The npm version command updates your package.json and automatically creates a git version tag for your project that you can push up to github.

    See something like https://medium.com/@jdaudier/how-to-create-and-publish-your-first-node-js-module-444e7585b738#.imf0mtv0q for a good "start to finish" on publishing your project to npm.