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

@zeelo/corejs

v0.9.0

Published

Core JS files for every JS site.

Downloads

40

Readme

FE Core

Adapters and Transformers

  • NON inherited entities:

    • The adapter implements both AdapterInterface and TransformerInterface.
    • The AdapterInterface will be used to adapt self data.
    • The TransformerInterface will be used to adapt data from the parent transformer if exists (when adapting mixed lists such as products list).
  • Inherited entities:

    • The adapter implements only AdapterInterface and its responsibility is using the proper injected adapter.
    • At the highest level we need only 1 transformer with the proper switch to call these adapters.
  • Use

    • If the data we are trying to transform is from a basic entity (EventProduct, Stop, Perk, ...) we are using the adapter and either the adapt method or the transform method (preferring the transform one so we can avoid the new entity call).
    • If the data we are trying to transform is from a parent entity (Product with type="event") we are using a factory with the EventProductAdapter injected. Inside the factory we will use a switch to determine which adapter we must use and then we will call the adapt method since this factory accepts only AdapterInterface.

Services

Every service will extend BaseEntityService since the logic is generic and reusable. Also we are typing the service with the proper entity to let the system (and the programmer) know what entity is being returned or used every time.

Clients

Every client will extend BaseEntityClient since the logic is generic and reusable. For clients we are only implementing the abstract method getBasepath() to let the system know where the endpoint starts.

Factories

The factories will be used to transform data from a mixed list or when the data comes from a parent entity and a type attribute (for example when retrieving data of an event product but the data is coming from a Products endpoint with the attribute type="product").

Scripts

Start

  • npm run start or npm start: Installs everything and launches webpack in dev mode.
  • npm run start:fresh: Removes node_modules and public folder and then runs npm start. This is mainly used for when changing some dependencies.

Webpack

  • npm run webpack:dev: Launches webpack in dev mode - watch and dev build. Use this one for dev mode when you don't need to install nor check dependencies.
  • npm run webpack:prod: Launches webpack in prod mode - production build.

Build

  • npm run build: Removes node_modules and public folder and then runs npm run webpack:prod for a fresh build production.

Tests

  • npm test or npm run test: Runs Jest testing.