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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mortonprod/product-upload

v1.0.3

Published

This is an npm package which acts as a node server to upload products to multiple servers.

Readme

Product-upload

Build Status Coverage Status npm version Dependecies

This is an npm package which acts as a node server to upload products to multiple servers. It can also act for a number of generic upload tasks. Think any situation where you need to upload a list of related objects in a database with images. Given some basic initialising information is will perform basic CRUD operation without you needing to design it.

By default node is used to send the UI and update the database. However, you can also setup the node server to simply send the new values to another server. That server will then run it's own implementation and return some success or failure notice. In the end you have three parts.

Parts

  • User UI (A generic number of components which will simply take a input json and output json with binary assets).
  • Initialised node middleware (It serves the user interface with needed input json and recieves the binary assets).
    • These assets and then redirects or passed to the default implementation to test the input.
  • Internal or external middleware to recieve output json and update databases and static assets.
    • Checks to perform on the database for each operation.
    • The changing of the database on the server.

User UI

This will be nothing but a series of inputs with a predefined relationships. Say we have product, what would be the information we will most likely need to store and change?

  • ID (string)
  • Name (string)
  • Price (string)
  • Categories (array of strings)
  • Description (string)
  • Colour (string)
  • Rating (number)
  • Size (string)
  • Number in stock (number)
  • Images (array of strings)
  • ...

These can be defined as react component which take some input, you interact with it, then it produces some output.

The output of the UI is then used by the node server to update the database.

Node Middleware

The node middle ware will recieve the json and assets and then pass this on to an external server or the inbuilt test implementation. Either way the server will wait until it has recieved a success or failure string which is then passed to the user interface.

It will also deal with authentication and cookie handling. You must pass in a mongodb. Check out the version used in package.json if your having problems.

Testing the Database

With the current assets the database must be checked before it is updated. The issues will be passed back to the node server as a list.

Saving the database

The entry with the current id will be updated. The entry will link to a single file with a list of unique images. In the end it will take in some input, try to save it. If there is an issue then it will return the final issue to the tester.

When connecting to the mongo db it will simply try to connect and link to the collection you specify. It will not change anything else in your database.

Installation

To install this component into your project run:

npm install @mortonprod/product-upload

Usage

Import the component like so:

import Product from @mortonprod/product-upload

then import the css:

import @mortonprod/product-upload/dist/index.css

Note you must pull the css independently of the component.

To run in development mode do:

npm run start

This will run the app on localhost:8080.

Installing Respository

Full Running Package

To build the test server with mongodb attached.

npm run server:build

To start the container

npm run server

Note this will stop all containers which you currently have running. A quick hack to make sure you are running the right container.

The User interface

If you need to play about with the UI without considering how it will be served the run

npm run watch

Scrapper

It also has a basic web-scaper set up to demonstrate functionality.

It is rather ad-hoc and points at the ann summers sitemap. It will strips each pages 1 hyperlink under the sitemap root, then it looks for a items object in each html page using jsdom. This items object contains everything we need to reconstruct the database. So we pull this object then correct some of the entries to match our static assets pulled with the scrapper. In the end the final data.json file is produced which the mongodb can access and populate it's own database.

To run yourself:

npm run scrape

Contributing

You are free to contribute to this component if you wish.