Created
August 28, 2018 02:10
-
-
Save christopheranderson/e3f0f0777e8a80919776a3ef5d8a4d6f to your computer and use it in GitHub Desktop.
create-hmac typescript default import
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
import createHmac from "create-hmac"; | |
const hmac = createHmac("sha256", "hello world").update("I love cupcakes").digest("hex"); | |
console.log(hmac); |
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
{ | |
"name": "scratch-hmac", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "ts-node --files --project ./tsconfig.json index.ts" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"create-hmac": "^1.1.7" | |
}, | |
"devDependencies": { | |
"@types/node": "^10.9.2", | |
"ts-node": "^7.0.1", | |
"typescript": "^3.0.1" | |
} | |
} |
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
import createHmac from "create-hmac"; | |
const hmac = createHmac("sha256", "hello world").update("I love cupcakes").digest("hex"); | |
console.log(hmac); |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"declaration": true, | |
"module": "commonjs", | |
"moduleResolution": "node", | |
"noImplicitAny": true, | |
"outDir": "./lib", | |
"preserveConstEnums": true, | |
"removeComments": false, | |
"target": "es6", | |
"sourceMap": true, | |
"newLine": "LF", | |
"lib": ["es6", "esnext.asynciterable"], | |
// Enable support for importing CommonJS modules targeting es6 modules | |
"esModuleInterop": true, | |
// When using above interop will get missing default export error from type check since | |
// modules use "export =" instead of "export default", enable this to ignore errors. | |
"allowSyntheticDefaultImports": true | |
}, | |
"include": ["./**.ts"], | |
"exclude": ["node_modules", "samples"] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment