"use strict"; const Promise = require("bluebird"); const fs = require("fs"); const path = require("path"); const detectSVGScripts = require("./"); Promise.try(() => { return detectSVGScripts(fs.createReadStream(path.join(__dirname, "test-svg/clock.svg"))); }).then((result) => { console.log(result); /* [ { type: 'inlineScriptTag', tag: { name: 'SCRIPT', attributes: [Object], isSelfClosing: false } } ] */ return fs.promises.readFile(path.join(__dirname, "test-svg/wpt.svg")); }).then((buffer) => { return detectSVGScripts(buffer); }).then((result) => { console.log(result); /* [ { type: 'eventHandler', tag: { name: 'SVG', attributes: [Object], isSelfClosing: false }, attribute: 'onload' }, { type: 'inlineScriptTag', tag: { name: 'SCRIPT', attributes: [Object], isSelfClosing: false } } ] */ });