This file contains 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
var generator = require('generate-password'); | |
var password = generator.generate({ | |
length: 10, | |
numbers: true | |
}); | |
// 'uEyMTw32v9' | |
console.log(password); |
This file contains 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
let config = jsOptions<Nodemail.Config>(fun opt -> | |
opt.auth <- {user=someUser;pass=password} | |
opt.port <- 465 | |
opt.host <- host | |
opt.secure <- true | |
opt.debug <- true | |
) | |
let message= jsOptions<Nodemail.Message>( fun msg -> | |
msg.subject <- title |
This file contains 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
module Mail | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Fable.PowerPack | |
open Fable.Import | |
module Nodemail = | |
type Auth = |
This file contains 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
open Fable.Import.Bcrypt | |
promise { | |
let! isOk = Bcrypt.compare(Some data, encryptedData) | |
if isOk then | |
printfn "I'm so happy!" | |
else | |
printfn "I'm still happy. But less" | |
} |
This file contains 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
// ts2fable 0.6.0-build.320 | |
module rec Fable.Import.Bcrypt | |
open System | |
open Fable.Core | |
open Fable.Import.JS | |
[<Import("default", from="bcrypt")>] | |
let Bcrypt: IExports = jsNative | |
type [<AllowNullLiteral>] IExports = |
This file contains 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("default", from="bcrypt")>] | |
let Bcrypt: IExports = jsNative |
This file contains 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
// ts2fable 0.6.0-build.320 | |
module rec Toto | |
open System | |
open Fable.Core | |
open Fable.Import.JS | |
type [<AllowNullLiteral>] IExports = | |
/// <param name="rounds">The cost of processing the data. Default 10.</param> | |
/// <param name="minor">The minor version of bcrypt to use. Either 'a' or 'b'. Default 'b'.</param> |
This file contains 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
// ts2fable 0.6.0-build.320 | |
module rec Fable.Import.JsonWebToken | |
open System | |
open Fable.Core | |
//open Fable.Import.JS | |
[<Import("default", from="JsonWebToken")>] | |
let JsonWebToken: IExports = jsNative |
This file contains 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
// ts2fable 0.6.0-build.320 | |
module rec Fable.Import.Howler | |
open System | |
open Fable.Core | |
open Fable.Import.JS | |
open Fable.Import.Browser | |
let [<Import("*","howler")>] howler: Howler.IExports = jsNative | |
let [<Import("*","howler")>] Howler: HowlerGlobal = jsNative | |
let [<Import("*","howler")>] Howl: HowlStatic = jsNative |