Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm:
node v14.20.1
endpoint
share
tweet
let SourceNode = require('source-map').SourceNode; function test(source) { let node = new SourceNode( null, null, source, [ 'prefix', new SourceNode(1, 0, source, 'code'), 'suffix', ] ); let { code, map } = node.toStringWithSourceMap(); console.log(map.toJSON(), code); } test("source"); test(null); test("");
Created from: https://npm.runkit.com/
Loading…
Clone and edit this document