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

gardr-validator-web

v0.7.3

Published

The Web ui for the garðr validator

Downloads

9

Readme

garðr-validator-web

Build Status

Build Status Build Status Coverage Status NPM version Dependency Status devDependency Status

Description: This is the web interface for the garðr validator project.

The main purpose is to find possible errors or regressions in display ads. Its intended to grow over time to a set of rules based on best practices for performance ( although displayads not necessarily can avoid document.write atm ).

The validator takes input as a scripturl or zipfile, html,css and javascript, and produces in 3 steps harvested data and a report.

How does the validator work?

It uses phantomJS as a browser, loads in a shim on top of the PhantomJS api, runs for a 10 seconds after all hooks have been innjected and data colelcted. After phantomjs run, the preoprocessors and validators/rules runs in a series to generate a report(info, warn, debug, error...).

Installation instructions

Install depedencies and package validator with package gardr(abit funky)

$ npm install

Run tests

$ npm test

Starting the application

Run server:

$ PORT=8000 npm start

Local development:

( if editing gardr-validator, run ´npm link´ in gardr-validator folder, and then link gardr-validator inside gardr-validator-web with ´npm link gardr-validator´)

$ npm run start-dev

If you need to debug output from phantomjs, add env variable TMP_DIR=/TMP_DIR.
Screenshots and json output from phantom will be outputted in a folder with id as name.
Additional startup configuration

You can configure port, logfile location, etc using the config module or by specifying environment variables when starting.

$ HTTP_PORT=1337 LOG_FILE_NAME=~/mylogs/pvw npm start

Where to get help

Create a github issue.

Contributing

YES, pull requests with tests. Be sure to create a issue and let us know you are working on it - maybe we can help out with insights etc.

Alternatives

(please let us know of alternatives to this project)


Current Deployment / validator.gardr.org production

! Prerequisite: Get your ssh-key added to our server at [email protected].

As the setup is Ubuntu with Dokku, you can SSH into git.gardr.org and use the dokku CLI, ref https://github.com/progrium/dokku. Added a couple of Dokku-plugins for rebuild and supervisord, but they are not needed.

  • Add dokku as remote to validator-web git-repo on your computer:

     git remote add [email protected]:validator
  • Push to dokku:

     git push dokku master

Direct SSH-access:

Redeploy via dokku / (throw away logs, files and database):

    dokku rebuild:all

Run command via dokku, e.g:

    dokku run validator ls -lha

Debugging / Accessing docker instance directly

To access the docker instance via ssh, first access gardr.org, then:

    docker ps

Get containerId and insert in next command where "my_container_id":

    PID=$(docker inspect --format '{{.State.Pid}}' my_container_id)

nsenter will give you direct shell access to the running docker container:

    nsenter --target $PID --mount --uts --ipc --net --pid

  • Application code will then be located in /app folder.
  • Application specific logs in /app/logs.
  • Leveldb are in same folder prefixed with result-db-$(version)-$(enviroment).
    • If database needs to be deleted, just remove this folder or bump the application version in package.json.
  • PhantomJS files wil output in tempoary directory, names if local in app directory phantom_output_files_$(version)_$(enviroment).
    • Phantom output directory might contain debug-input-$(timestamp).json, and output-$(timestamp).json as well as screenshots named $(width)x$(height)_$(timestamp).png.