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

vf-core-service-discovery

v0.1.0-beta.6

Published

A tool to analyse the usage of vf-core in your project

Downloads

4

Readme

Build Codecov David npm license

:warning: This project is currently in active development; use with caution. Thanks!

Demo: https://youtu.be/gF6YAm6Totg

vf-core-service-discovery is a tool to analyse the usage of vf-core in your project.

Table of contents

Install

Install the package using npm or yarn as follows:

$ npm i vf-core-service-discovery
$ yarn add vf-core-service-discovery

or globally

$ npm i -g vf-core-service-discovery
$ yarn global add vf-core-service-discovery

Basic usage

CLI

The main usage of vf-core-service-discovery is through a CLI. A simple run of the following command will gather the usage of vf-core in the project:

$ vf-core-service-discovery run

An output example:

Module

vf-core-service-discovery can also be used as a module. A use case for this is if you want to have more control on the process.

import ServiceDiscovery from 'vf-core-service-discovery';

async function run() {
  const serviceDiscovery = ServiceDiscovery.getInstance();

  await serviceDiscovery.setup({
    forceRun: false,
    verbose: true,
    logFile: 'test.log',
    loggingEnabled: true,
    profile: false,
  });

  const items = await serviceDiscovery.run(true);

  console.log(items);
}

run();

Features

  • Get package information such as current version, latest version, and component status.
  • Get changelog if current and latest versions are mismatched.
  • For each installed component get the dependent files (for now only .html files).

CLI documentation

| Synopsis | Description | |----------------------|---------------------------| | run | Run the service discovery | | config [key] [value] | Manage the configuration |

run

Synopsis: vf-core-service-discovery run [options]

Options

| Option | Type | Default | Description | |-------------------------|---------|---------------------------------|-----------------------------| | -v, --verbose | boolean | false | Show debug information | | -l, --log-file | string | 'vf-core-service-discovery.log' | Log file location | | -f, --force | boolean | false | By-pass the cache | | -p, --profile | boolean | false | Profile the service discovery | | -r, --reporters | array | ['cli'] | The reporters to use (cli, json, html) | | -d, --disabled | array | [] | List of disabled steps (from getConfig, getChangelog getDependents) | | -o, --only-outdated | boolean | false | Display only outdated components | | -m, --format | string | '' | Specifies the formatting for the results | | -c, --compare-versions | boolean | false | Shows the visual difference between different component versions | | -t, --project-type | string | autoDetect | Defines the project type for use in the dependents discovery phase. Possible values are: html, angular, react, autoDetect | | -i, --ignore | array | [node_modules] | Defines the ignored paths for the dependents discovery phase |

Custom formatting

If you would like to use your own formatting for displaying the results in the CLI you can specify the --format option. The following tokens are used for displaying specific information for each discovery item:

  • %name: component name
  • %usedVersion: the version installed by your project
  • %latestVersion: the package's latest version
  • %changelog(...): the changelog if applicable (i.e. if used version != latest version)
  • %changelog(...%version...): the version of a changelog item
  • %changelog(...%changes(...)...): the changes of a changelog item
  • %changes(...$change...): the actual change in a changelog item
  • $dependents(...): the dependents
  • $dependents(...$depenent...): the dependent item

Examples

$ vf-core-service-discovery --format "%name (%usedVersion, %latestVersion)"
$ ...
$ vf-box (1.5.6, 1.6.0)
$ vf-card (2.1.4, 2.1.4)
$ vf-core-service-discovery --format "%name\nChangelog\n%changelog(%version\n%changes(> %change)\n)"
$ vf-box
$ Changelog
$ 2.3.0
$ > updates font size for title/heading> makes sure the text is black inside the `--easy` variant.

$ vf-grid
$ Changelog
$ 1.4.0
$ > fixes flexbox fallback grid when there are items on two or more rows> fixes widths on flexbox fallback grid.
$ 1.3.0
$ > makes the layout something that can now use 'extends' within nunjucks

config

Synopsis: vf-core-service-discovery config [key] [value] [options]

Configuration items

| Key | Value | Default | Description | |---------------------|--------|---------|------------------------------------------| | cacheExpiry | string | '8h' | Time before the cache expires | | lastInvalidation | Date | null | Last time the cache has been invalidated | | vfCoreVersion | string | '' | Latest vf-core release version |

Options

| Option | Type | Default | Description | |--------------------|---------|---------------------------------|---------------------------------| | -v, --verbose | boolean | false | Show debug information | | -l, --log-file | string | 'vf-core-service-discovery.log' | Log file location | | -r, --reset | boolean | false | Reset configuration to defaults |

Module documentation

Check the module documentation here: https://oss6.github.io/vf-core-service-discovery.

What's next

  1. Find dependents in different types of projects (for a start Angular and React).
  2. API documentation using TypeDoc.
  3. Add performance tests.

Contributing

We welcome contributors and maintainers! To contribute please check the contributing page out.