Update index.js

add `close` method