/** * Stringify a Unist node representation of a file * (in string or VFile representation) into a string * using the `Compiler` on the processor. * * @param {Node} node - Unist node. * @param {(string|VFile)?} [file] - File representation. * @param {Object?} [options] - Configuration. * @return {string} - String representation. */ function stringify(node, file, options) { assertConcrete('stringify'); assertCompiler('stringify'); assertNode(node); if ( !options && !string(file) && !buffer(file) && !(typeof file === 'object' && 'messages' in file) ) { options = file; file = null; } return new processor.Compiler(vfile(file), options, processor).compile(node); }