Skip to content

Instantly share code, notes, and snippets.

View darcyclarke's full-sized avatar
🔥
busy building things...

Darcy Clarke darcyclarke

🔥
busy building things...
View GitHub Profile
@darcyclarke
darcyclarke / vsr-next-manifest
Created March 17, 2025 16:41
VSR Response Examples
{
"name": "next",
"version": "15.2.2",
"keywords": [
"react",
"framework",
"nextjs",
"web",
"server",
"node",
@darcyclarke
darcyclarke / package.json
Created February 26, 2025 16:41
High Impact npm Packages (ie. >1 million weekly downloads or >500 dependants)
{
"packages": [
"semver",
"ansi-styles",
"supports-color",
"chalk",
"tslib",
"debug",
"has-flag",
"ms",
@darcyclarke
darcyclarke / checks.json
Created February 26, 2025 16:32
`reproduce` checks against high impact npm packages
This file has been truncated, but you can view the full file.
{
"semver": {
"reproduceVersion": "0.0.1-pre.1",
"timestamp": "2025-02-25T11:08:01.729Z",
"os": "darwin",
"arch": "arm64",
"strategy": "npm:10.9.1",
"reproduced": true,
"package": {
"spec": "semver",
@darcyclarke
darcyclarke / index.js
Last active December 21, 2024 10:15
Dynamic Package Install & Import
import { spawnSync } from 'node:child_process'
import { resolve } from 'node:path'
const name = 'lodash'
const opts = {
cwd: './tmp'
}
const { status } = spawnSync('npm', ['install', name], opts)
if (status !== 0) {
throw new Error('Failed to install package')
}
@darcyclarke
darcyclarke / bug.yml
Last active November 29, 2023 19:57
Managing Releases + Version Labels + Issues w/ Version Fields
# .github/ISSUE_TEMPLATE/bug.yml
# A basic bug template...
# NOTE: `id` must be set for the `version` & correspond to...
# whatever the value you reference later when you parse an issue
name: Bug w/ Input
description: Something bad happened
labels: [bug]
body:
- type: input
@darcyclarke
darcyclarke / get-authors-from-deps.js
Created March 9, 2022 18:49
Get All Contributors From Dependencies
const{ promisify } = require('util')
const Arborist = require('@npmcli/arborist')
const read = promisify(require('read-package-json'))
const arb = new Arborist({ path: '.' })
arb.loadActual().then(async tree => {
const authors = {}
const deps = []
function store (author) {
if (author.email && !authors[author.email]) {
authors[author.email] = author
@darcyclarke
darcyclarke / package.json
Last active October 7, 2020 03:49
npm prepublish check for package@version existence
{
"scripts": {
"prepublish" : "[[ $(npm view $npm_package_name@$npm_package_version --silent) ]] && echo \"error: $npm_package_name@$npm_package_version exists already!\" && exit 1 || echo \"successful check: $npm_package_name@$npm_package_version does not exist already\""
}
}
@darcyclarke
darcyclarke / npm-audit.sh
Last active October 7, 2020 22:00
A `npm audit <pkg>` proof-of-concept in bash...
#!/bin/bash
PKG=package.json
DIR=npm-audit-tmp
mkdir $DIR && cd $DIR && [[ $* == *--dry-run* && -f "../$PKG" ]] && cp "../$PKG" $PKG || echo '{}' >$PKG && npm i $1 --no-audit --package-lock-only --silent; npm audit; cd ../ && rm -rf $DIR
# Installation:
# 1. copy this into a file: /usr/local/bin/npm-audit
# 2. make it executable: chmod +x /usr/local/bin/npm-audit
# Usage:
@darcyclarke
darcyclarke / inject.js
Last active March 24, 2020 15:52
Facebook Sponsored Ad Filter - Use this w/ your preferred script injector (ex. "CJS" on Chrome or "Code Injector" on FF)
// Updated & working as of March 24th, 2020
;(() => {
function removeAds() {
Array.from(document.querySelectorAll('[id^=feed_sub_title], [data-testid^=story-subtilte], [data-pagelet^=FeedUnit]'))
.map(e => {
let content = e.innerText
let dynamic = Array.from(e.querySelectorAll('span:not([data-content=""])'))
.filter(e => e.style.display != 'none')
.map(e => {
let hidden = window.getComputedStyle(e, ':before').getPropertyValue('content')
@darcyclarke
darcyclarke / keybase.md
Created April 6, 2017 17:57
keybase.md

Keybase proof

I hereby claim:

  • I am darcyclarke on github.
  • I am darcyclarke (https://keybase.io/darcyclarke) on keybase.
  • I have a public key ASD4yo0sZAq8GW7-sMMPykFBSvT1luv3MwlvIVmXrBeRLQo

To claim this, I am signing this object: