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

@soft-treasures/gem-url-builder

v1.0.2

Published

This is an utility to build an url leveraging functional programming approaches

Downloads

5

Readme

gem-url-builder

This is an utility to build an url leveraging functional programming approaches

Disclaimer

This package has not been veiwed through a security and performance lens. This does not claim to be production ready . There are some aspects only that is production ready. This probably will not satisfy the functional programming purists.My justification is that this is a learning process for me and any critical assesment is welcome

Intended Usage

This is to show case a real life production package with all the bells and whistles required for a production ready release. For instance this includes features listed below.

  • Manage configuration across various environments
  • Extensive Quality checks with unit tests
  • Monitor and Attest the Code Quality with code coverage which is one of the prerecquistes for a sucessful agile shop.
  • Integrated with babel to permit ES 2016 features.
  • Integrated with webpack for deployment.

This is to meet the need for a production ready approach rather than just a bare bones tutorial meant to demostrate the concepts. However not this is not yet production ready . There are a number of prerequites that are missing. The intent is to provide approaches to some of chalenges that are encountered when a real life production release is attempted.

Architecture Review

This has been inspired by © 2020 James Sinclair who has eloquently proposed this possible solution.

Background Information

This implements elegant error handlying leveraging the Either Monad .The well known industry recomendation is for the application to fail gracefully and provide the consumer/user with an useful message. Generally the solution proposed is cascading try catch blocks in the imperative programming paradigm . IMHO I prefer the functional programming paradigm. In this paradigm the prescribed approach is all functions require to be pure There is an ongoing debate but one opinion is that throwing an exception inside the function renders it impure see here.I agree to this point of view since it no longer is allways deterministic.In some cases there are unintended side effect.

High level Philosophy

In the functional programming paradigm instead of throwing exceptions a Right or Left instance is returned. This objects implement the same interface as is evident from the below screenshots . The Right instance represents the error free object and Left represents the error use case.

Right Class

Right Class

Left Class

Left Class

Features included

Unit Tests

Unit Tests Screenshot

Test Coverage Report

Includes unit tests with 90+ code coverage see image Test Coverage Report

Get Test Coverage Report

On the on the root folder run this command in the terminal see image below

npm run-script test-coverage

Get Test Coverage Report

Environment Variables

This feature is implemented leveraging cross-env npm package

Other Related References

Managing environment variables in Nodejs and Modern JS apps

JSDocs documentation

To generate JSDocs documentation run below command in the terminal

jsdoc src -r -d docs

 Package Documentation

References

JsDoc

Acknowledgements

This is an adaptation of the orginal code authored by James Sinclair

Pending To Do List

  • [] Security Review
  • [] Performance Review
  • [] Compilance with well known Functional Programming industry standards

References

  1. babel
  2. webpack
  3. JsDoc
  4. cross-env
  5. © 2020 James Sinclair