GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: refactor `tools/license2rtf` to ESM · nodejs/node@30cb1bf

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Makefile
  • tools
    • license2rtf.mjs
  • vcbuild.bat
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ endif
10961096
$(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules
10971097
unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npm
10981098
unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npx
1099-
$(NODE) tools/license2rtf.js < LICENSE > \
1099+
$(NODE) tools/license2rtf.mjs < LICENSE > \
11001100
$(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf
11011101
cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources
11021102
pkgbuild --version $(FULLVERSION) \
Collapse file

‎tools/license2rtf.js‎ ‎tools/license2rtf.mjs‎tools/license2rtf.js renamed to tools/license2rtf.mjs

Copy file name to clipboardExpand all lines: tools/license2rtf.mjs
+12-18Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
'use strict';
2-
3-
const assert = require('assert');
4-
const Stream = require('stream');
5-
1+
import assert from 'node:assert';
2+
import Stream from 'node:stream';
3+
import { pipeline } from 'node:stream/promises';
4+
import { stdin, stdout } from 'node:process';
65

76
/*
87
* This filter consumes a stream of characters and emits one string per line.
@@ -287,19 +286,14 @@ class RtfGenerator extends Stream {
287286
}
288287
}
289288

290-
291-
const stdin = process.stdin;
292-
const stdout = process.stdout;
293-
const lineSplitter = new LineSplitter();
294-
const paragraphParser = new ParagraphParser();
295-
const unwrapper = new Unwrapper();
296-
const rtfGenerator = new RtfGenerator();
297-
298289
stdin.setEncoding('utf-8');
299290
stdin.resume();
300291

301-
stdin.pipe(lineSplitter);
302-
lineSplitter.pipe(paragraphParser);
303-
paragraphParser.pipe(unwrapper);
304-
unwrapper.pipe(rtfGenerator);
305-
rtfGenerator.pipe(stdout);
292+
await pipeline(
293+
stdin,
294+
new LineSplitter(),
295+
new ParagraphParser(),
296+
new Unwrapper(),
297+
new RtfGenerator(),
298+
stdout,
299+
);
Collapse file

‎vcbuild.bat‎

Copy file name to clipboardExpand all lines: vcbuild.bat
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ if "%use_x64_node_exe%"=="true" (
420420
set exit_code=1
421421
goto exit
422422
)
423-
%x64_node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
423+
%x64_node_exe% tools\license2rtf.mjs < LICENSE > %config%\license.rtf
424424
) else (
425-
%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
425+
%node_exe% tools\license2rtf.mjs < LICENSE > %config%\license.rtf
426426
)
427427

428428
if errorlevel 1 echo Failed to generate license.rtf&goto exit

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.