MCPcopy Index your code
hub / github.com/nodejs/node / stringify

Function stringify

lib/internal/modules/helpers.js:451–457  ·  view source on GitHub ↗

* Converts a buffer or buffer-like object to a string. * @param {string | ArrayBuffer | ArrayBufferView} body - The buffer or buffer-like object to convert to a string. * @returns {string} The resulting string.

(body)

Source from the content-addressed store, hash-verified

449 * @returns {string} The resulting string.
450 */
451function stringify(body) {
452 if (typeof body === 'string') { return body; }
453 assertBufferSource(body, false, 'load');
454 const { TextDecoder } = require('internal/encoding');
455 DECODER = DECODER === null ? new TextDecoder() : DECODER;
456 return DECODER.decode(body);
457}
458
459/**
460 * Enable on-disk compiled cache for all user modules being compiled in the current Node.js instance

Callers 3

translators.jsFile · 0.50
createCJSModuleWrapFunction · 0.50

Calls 3

assertBufferSourceFunction · 0.85
requireFunction · 0.70
decodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…