diff --git a/index.js b/index.js index 44797d7..6ef763b 100644 --- a/index.js +++ b/index.js @@ -71,4 +71,13 @@ function prettyPrint(xml, opts = { indentSize: 2 }) { return pool.run({ fn: 'prettyPrint', args: [xml, opts] }) } -module.exports = { transform, toJson, prettyPrint } +/** + * destroy the worker pool + */ +function destroy() { + if (pool && typeof pool.destroy === 'function') { + return pool.destroy(); + } +} + +module.exports = { transform, toJson, prettyPrint, destroy }