Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "perf: use node: prefix to bypass require.cache call for builtins (#644)" #660

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ The standalone mode is used to compile the code that can be directly run by `nod
itself. You need to have `fast-json-stringify` installed for the standalone code to work.

```js
const fs = require('node:fs')
const fs = require('fs')
const code = fastJson({
title: 'default string',
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bench-cmp-branch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { spawn } = require('node:child_process')
const { spawn } = require('child_process')

const cliSelect = require('cli-select')
const simpleGit = require('simple-git')
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bench-thread.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { workerData: benchmark, parentPort } = require('node:worker_threads')
const { workerData: benchmark, parentPort } = require('worker_threads')

const Benchmark = require('benchmark')
Benchmark.options.minSamples = 100
Expand Down
4 changes: 2 additions & 2 deletions benchmark/bench.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const path = require('node:path')
const { Worker } = require('node:worker_threads')
const path = require('path')
const { Worker } = require('worker_threads')

const BENCH_THREAD_PATH = path.join(__dirname, 'bench-thread.js')

Expand Down
4 changes: 2 additions & 2 deletions build/build-schema-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const Ajv = require('ajv')
const standaloneCode = require('ajv/dist/standalone').default
const ajvFormats = require('ajv-formats')
const fs = require('node:fs')
const path = require('node:path')
const fs = require('fs')
const path = require('path')

const ajv = new Ajv({
addUsedSchema: false,
Expand Down
2 changes: 1 addition & 1 deletion examples/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const http = require('node:http')
const http = require('http')

const stringify = require('fast-json-stringify')({
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const merge = require('@fastify/deepmerge')()
const clone = require('rfdc')({ proto: true })
const { randomUUID } = require('node:crypto')
const { randomUUID } = require('crypto')
const { RefResolver } = require('json-schema-ref-resolver')

const validate = require('./lib/schema-validator')
Expand Down
4 changes: 2 additions & 2 deletions test/standalone-mode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const test = require('tap').test
const fjs = require('..')
const fs = require('node:fs')
const path = require('node:path')
const fs = require('fs')
const path = require('path')

function build (opts, schema) {
return fjs(schema || {
Expand Down
2 changes: 1 addition & 1 deletion test/webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const test = require('tap').test
const webpack = require('webpack')
const path = require('node:path')
const path = require('path')

test('the library should work with webpack', async (t) => {
t.plan(1)
Expand Down
Loading