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

upkeeper

v0.8.4

Published

Script generator for deps updating

Downloads

4

Readme

upkeeper

Script generator for deps updating

lcov npm

Status

PoC

Idea

To implement deps updating in form of git patches. As a part of Hackathon We Make QIWI 2.0 2023.

Requirements

  • git
  • echo
  • sedoptional
  • nodejs for generation phase only

Install

npm i upkeeper

Usage

import {upkeeper} from 'upkeeper'

const config = {
  granularity:  'proposal', // Granularity level: 'proposal' | 'same' | 'resource' | 'all-in'
  keepers: [
    ['npm', {
      resources:  'package.json', // package.json,packages/*/package.json
      scopes:     ['dependencies', 'devDependencies'],
      exlude:     'react',
    }]
  ],
  dryrun:   true,       // Do not apply changes
  combine:  false,      // Join all patches into one script
  diff:     'sed',      // Diff-patch provider: git or sed
  output:   'patches',  // a directory to store patches
  pre:      '',         // a scripts to run before & after each patch
  post:     'yarn install && git add . && git commit -m "chore(deps): update deps" && git push origin HEAD:refs/heads/up-deps'
}

const {scripts, proposals} = await upkeeper(config)

granularity

Choose a scripts aggregation strategy to produce appropriate patches. Default is proposal.

| Level | Description | |------------|------------------------------------------------------------------------------------------| | proposal | Produces a patch for each proposal: resource + dep name + dep version | | same | Generates script for each common proposal: dep name + dep version. Useful for monorepos. | | resource | Joins changes for each resource entry | | all-in | A single patch for all deps in all resources |

dot

dot is used as a template engine for pre and post options, so you can inject proposal metadata into your scripts.

{
   pre: 'echo "updated {{=it.data.name}} to {{=it.data.version}}"'
}
// 'echo "updated @emotion/css to ^11.2.0"

CLI

npx upkeeper --config=config.json --output='patches'
sh patches/upkeeper.sh

Output

#!/usr/bin/env bash
set -e

echo pre
echo $'diff --git a/packages/blank/package.json b/packages/blank/package.json\n--- a/packages/blank/package.json\n+++ b/packages/blank/package.json\n@@ -46,6 +46,6 @@\n   "homepage": "https://github.com/antongolub/misc#readme",\n   "devDependencies": {\n     "@antongolub/infra": "workspace:*",\n-    "@types/node": "^20.10.3"\n+    "@types/node": "^20.10.4"\n   }\n }\n' | git apply --whitespace=fix --inaccurate-eof
echo post

echo pre
echo $'diff --git a/packages/infra/package.json b/packages/infra/package.json\n--- a/packages/infra/package.json\n+++ b/packages/infra/package.json\n@@ -23,7 +23,7 @@\n     "@semrel-extra/topo": "^1.14.0",\n     "c8": "^8.0.1",\n     "concurrently": "^8.2.2",\n-    "esbuild": "^0.19.8",\n+    "esbuild": "^0.19.9",\n     "esbuild-node-externals": "^1.11.0",\n     "eslint": "^8.55.0",\n     "eslint-config-qiwi": "^2.1.3",\n' | git apply --whitespace=fix --inaccurate-eof
echo post
# ...

| Option | Description | Default | |-----------------|-------------------------------------|-----------------------------------| | --cwd | Working directory | process.cwd() | | --config | Path to config file | | | --combine | Join all patches into one script | false | | --diff | Diff-patch provider: git or sed | git | | --dryrun | Do not apply changes. | true if --ouput option is set | | --granularity | Granularity level | proposal | | --output | Output directory | |

Refs

Updaters

Bots

Patchgen

License

MIT