node/test/fixtures/sea/get-asset-keys.js
Joyee Cheung 6428e2e4ca
sea: implement sea.getAssetKeys()
This adds a new API to allow the bundled script in SEA to query
the list of assets.

PR-URL: https://github.com/nodejs/node/pull/59661
Refs: https://github.com/nodejs/single-executable/discussions/112
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-09-04 11:58:50 +00:00

10 lines
212 B
JavaScript

'use strict';
const { isSea, getAssetKeys } = require('node:sea');
const assert = require('node:assert');
assert(isSea());
const keys = getAssetKeys();
console.log('Asset keys:', JSON.stringify(keys.sort()));