npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jscombguid

v1.0.8

Published

JavaScript module used to create comb guids.

Downloads

27

Readme

JsCombGuid

npm version

A simple JavaScript Comb Guid Generator.

No guarantees it's perfect!

That being said, we have run tests generating 100,000 ids and not having any duplicates. Guids are generated based on current date/ time and this data is used to create the sequential unique identifiers.

Primary concept of the code was sparked within this discussion http://stackoverflow.com/a/8809472/173949.

Getting Started

Installing

Pretty simple implementation, simply import the module, and you're off an running!

npm install jscombguid

And cheap node example usage;

const comb = require("jscombguid");

console.log(comb.generateCombGuid());

Running the tests

The library source includes some straight forward mocha tests and a duplicate check test which executes 10,000 cycles of guid generation check for duplicates being created. These tests sre located in the test/index.test.js file.

To execute the tests fire off the following line of code in your fav tool.

npm run test

.nyc_output directory will have the coverage reports outputted to the coverage directory. To view this report, and you have http-server, a handy basic insta web server, you can instal it and simply run; Total overkill for this small package, but a good example of code coverage reporting.

npm i -g http-server

Then fire it up and run it post the test execution;

http-server ./coverage/lcov-report/

and check out the server site at http://127.0.0.1:8080

Built With

  • momentjs - used in working with date time to generate the combs (direct dependency)
  • mocha - unsed in the unit testing of the simple function
  • instabul - used to validate test coverage and reporting
  • eslint - used for housekeeping and sanity
  • babel - used to bust down the code, we aren't doing anything that would fully constitute this however

Development

After cloning the repo run;

npm install

From that point, there are 3 possible scripts to run;

  1. build - runs lint, tests, then babel
  2. lint - runs eslint
  3. test - runs the mocha tests

To start, just run a build;

npm run build

And away you go. This is an overblown project repo, with probably more going on than necessary, however, it is a proof of concept on all aspects of npm package development. That being said, there are a few references which are worth mentioning here;

  1. Developing and Publishing an NPM Package
  2. BadgeFury
  3. How to Build and Publish an NPM Package
  4. Automate your NPM publish with GitHub Actions

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Big thanks to @thetinomen he refactored out the sophmoric code...