Comparing version
@@ -446,4 +446,3 @@ import type { ProcessEnvOptions, SpawnSyncReturns } from 'node:child_process'; | ||
interface Result extends SpawnSyncReturns<string | Buffer> | ||
{ } | ||
type Result = SpawnSyncReturns<string | Buffer>; | ||
} | ||
@@ -483,3 +482,3 @@ | ||
*/ | ||
reporter?: string | string[] | undefined; | ||
reporter?: string | string[] | undefined; | ||
@@ -490,3 +489,3 @@ /** | ||
*/ | ||
reporterOptions?: Record<string, Record<string, unknown>>; | ||
reporterOptions?: Record<string, Record<string, unknown>>; | ||
@@ -499,6 +498,6 @@ /** | ||
*/ | ||
skipFull?: boolean | undefined; | ||
skipFull?: boolean | undefined; | ||
/** Thresholds for low and high code coverage watermarks, exposed by some reporters. */ | ||
watermarks?: Watermarks | undefined; | ||
watermarks?: Watermarks | undefined; | ||
} | ||
@@ -505,0 +504,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { requireAsC8 } from './utils.js'; | ||
import c8 from 'c8'; | ||
import { requireAsC8 } from './utils.js'; | ||
import { Report as c8Report } from 'c8'; | ||
@@ -7,4 +7,2 @@ const { createContext } = requireAsC8('istanbul-lib-report'); | ||
const c8Report = c8.Report; | ||
export default function createReport(opts) | ||
@@ -11,0 +9,0 @@ { |
@@ -0,6 +1,6 @@ | ||
import { createReadStream } from 'node:fs'; | ||
import { extname, resolve } from 'node:path'; | ||
import { createInterface } from 'node:readline'; | ||
import fgExecAsync from './foreground-exec-async.js'; | ||
import { c8js_version, createDirectory, deleteDirectory } from './utils.js'; | ||
import { createReadStream } from 'fs'; | ||
import { extname, resolve } from 'path'; | ||
import { createInterface } from 'readline'; | ||
@@ -7,0 +7,0 @@ export default async function doExec |
@@ -1,2 +0,2 @@ | ||
import { spawn } from 'child_process'; | ||
import { spawn } from 'node:child_process'; | ||
@@ -134,4 +134,3 @@ const MAX_BUFFER = 1024 * 1024; | ||
if (maxBuffer == null) | ||
maxBuffer = MAX_BUFFER; | ||
maxBuffer ??= MAX_BUFFER; | ||
validateTimeout(timeout); | ||
@@ -196,4 +195,3 @@ validateMaxBuffer(maxBuffer); | ||
let { killSignal } = options; | ||
if (killSignal == null) | ||
killSignal = 'SIGTERM'; | ||
killSignal ??= 'SIGTERM'; | ||
validateKillSignal(killSignal); | ||
@@ -200,0 +198,0 @@ const killChild = |
@@ -0,3 +1,3 @@ | ||
import { readFileSync } from 'node:fs'; | ||
import { requireAsC8 } from './utils.js'; | ||
import { readFileSync } from 'fs'; | ||
@@ -29,4 +29,4 @@ const Yargs = requireAsC8('yargs/yargs'); | ||
'reporterOptions', | ||
'reportsDirectory', | ||
'resolve', | ||
'reportsDirectory', | ||
'skipFull', | ||
@@ -33,0 +33,0 @@ 'src', |
@@ -0,5 +1,5 @@ | ||
import { isAbsolute, join, normalize, resolve as resolvePath } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import parseConfig from './parse-config.js'; | ||
import { requireAsC8 } from './utils.js'; | ||
import { isAbsolute, join, normalize, resolve as resolvePath } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
@@ -6,0 +6,0 @@ const defaultExclude = requireAsC8('@istanbuljs/schema/default-exclude.js'); |
@@ -1,4 +0,4 @@ | ||
import fsPromises, { mkdir } from 'fs/promises'; | ||
import { createRequire } from 'module'; | ||
import { relative } from 'path'; | ||
import { mkdir, rm } from 'node:fs/promises'; | ||
import { createRequire } from 'node:module'; | ||
import { relative, sep } from 'node:path'; | ||
@@ -15,10 +15,3 @@ const MKDIR_OPTIONS = { recursive: true }; | ||
export const deleteDirectory = | ||
(() => | ||
{ | ||
const rm = fsPromises.rm /* c8 ignore next */ ?? fsPromises.rmdir; | ||
const deleteDirectory = path => rm(path, RM_OPTIONS); | ||
return deleteDirectory; | ||
} | ||
)(); | ||
export const deleteDirectory = path => rm(path, RM_OPTIONS); | ||
@@ -36,3 +29,3 @@ export const requireAsC8 = | ||
{ | ||
const standardPath = relative(cwd, path).replace(/\\/g, '/'); // standardize path for Windows. | ||
const standardPath = relative(cwd, path).replaceAll(sep, '/'); // standardize path for Windows. | ||
return standardPath; | ||
@@ -39,0 +32,0 @@ } |
{ | ||
"name": "c8js", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "A modern, asynchronous Node.js API for c8", | ||
@@ -34,9 +34,10 @@ "keywords": [ | ||
"@types/istanbul-lib-coverage": "2", | ||
"@types/node": ">=14", | ||
"c8": ">=8 <=9.1.0", | ||
"@types/node": ">=16", | ||
"c8": ">=8 <=10.1.2", | ||
"which": "4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@origin-1/eslint-config": "eslint-8", | ||
"@origin-1/eslint-config": "latest", | ||
"eslint": "latest", | ||
"eslint-formatter-compact": "latest", | ||
"mocha": "latest", | ||
@@ -54,3 +55,3 @@ "ts-node": "latest", | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=16" | ||
}, | ||
@@ -57,0 +58,0 @@ "exports": { |
@@ -139,5 +139,6 @@ # c8js | ||
c8js requires Node.js 14 or later. | ||
c8js requires Node.js 16 or later. | ||
The minimum supported c8 version is 8.0.0. | ||
[npm badge]: https://img.shields.io/npm/v/c8js?logo=npm | ||
[npm url]: https://www.npmjs.com/package/c8js |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
144
0.7%1
-80%0
-100%49366
-0.2%8
14.29%1271
-0.86%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated