Skip to content

Instantly share code, notes, and snippets.

View drugoi's full-sized avatar
🏠
Working from home

Nikita Bayev drugoi

🏠
Working from home
View GitHub Profile
@bartvanandel
bartvanandel / yarn-sync.js
Last active November 24, 2024 20:48
Sync versions from yarn.lock back into package.json
const fs = require("fs");
/**
* Removes matching outer quotes from a string.
*
* @param {string} text - String to unquote
* @returns {string} - Unquoted string
*/
const unquote = text => /(["'])?(.*)\1/.exec(text)[2];
@musatov
musatov / monoRepoTotalCoverage.js
Created May 20, 2023 14:47
This script automates code coverage reports in a monorepo setup using Jest and Turborepo. It collects and merges data from each package, providing a holistic view of code quality. Assumes a setup with each package outputting coverage data in a 'coverage' folder.
const fs = require('fs')
const path = require('path')
// Params
const pathToPreviousReport = process.argv[2]
// Functions
/**
* Reads the coverage-summary.{XXX}.json file and returns the parsed JSON object
* @param {*} pathToReport
* @returns