From c9b91e3c93d1403c83aad6567c547702dd9ea809 Mon Sep 17 00:00:00 2001 From: Eric Dauenhauer Date: Fri, 21 Jun 2024 12:03:52 -0500 Subject: [PATCH] fix specs on node 18.20.3 --- cli.js | 8 ++++---- package.json | 4 +++- test/test.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cli.js b/cli.js index a1efc3f..c49e540 100755 --- a/cli.js +++ b/cli.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -import fs from 'node:fs' -import path from 'node:path' -import readline from 'node:readline' -import { flatten } from './index.js' +const fs = require('node:fs') +const path = require('node:path') +const readline = require('node:readline') +const { flatten } = require('./index.js') const filepath = process.argv.slice(2)[0] if (filepath) { diff --git a/package.json b/package.json index 17d4e73..23bcbd4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,9 @@ "name": "@activeprospect/flat", "version": "5.0.4", "main": "index.js", - "bin": "cli.js", + "bin": { + "flat": "cli.js" + }, "scripts": { "test": "node --test && standard cli.js index.js test/test.js" }, diff --git a/test/test.js b/test/test.js index 6c735fc..2821bd6 100644 --- a/test/test.js +++ b/test/test.js @@ -4,7 +4,7 @@ const { readFileSync } = require('node:fs') const path = require('node:path') const { describe, test } = require('node:test') const { flatten, unflatten } = require('../index.js') -const pkg = JSON.parse(readFileSync('./package.json')) +const pkg = JSON.parse(readFileSync('./package.json').toString()) const primitives = { String: 'good morning',