Last active
June 18, 2019 13:23
-
-
Save chathurawidanage/cd0e6314090675bf42dc1fc775c52e49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { execSync } = require('child_process'); | |
let oldRequire = require; | |
require = function(module) { | |
try{ | |
oldRequire.resolve(`/tmp/node_modules/${module}`); | |
}catch(e){ | |
execSync(`npm install --prefix /tmp --save ${module}`); | |
} | |
return oldRequire(`/tmp/node_modules/${module}`); | |
} | |
/* JUST FORGET EVERYTHING AND START YOUR CODE FROM THIS POINT ONWARDS*/ | |
let reverseString = require('reverse-string'); | |
let mathjs = require('mathjs'); | |
exports.handler = (event, context, callback) => { | |
callback(null, reverseString(' = evitavired')+mathjs.derivative('x^2 + x', 'x')); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment