fumofumo
v1.0.0
Published
fumofumo
Downloads
12
Readme
FumoFumo.js
A js module for all fumo fans, that based on github project ZacharinC/RandomFumosSite
.
examples
A simple example for browser runtime
<script src="fumo.js"></script>
<script src="download.js"></script>
<script>
// Random and download an fumo
FumoFumo().then( function( fumo ){
download( fumo.fumo().src )
})
</script>
A simple example for nodejs runtime
// Random and download an Touhou fumo By keyword reimu
const Fumo = require( "./fumo" )
Fumo().then(function( fumo ){
const {get} = require( "https" ),
fs = require( "fs" ),
myfumo = fumo.touhouFumo( "reimu" )
get( myfumo.src, ( res ) => {
console.log( myfumo.label )
// Reimu Hakurei Fumo
res.pipe( fs.createWriteStream( "fumo.png" ) )
})
}).catch(console.error)
methods
async function FumoFumo( api : string = "https://zacharinc.github.io/RandomFumosSite/" ) : _FumoFumo object fumo{src, label, genre} class _FumoFumo
- constructor( api : string )
- fumo( name? : string ) : fumo
- touhouFumo( name? : string ) : fumo
- vocalFumo( name? : string ) : fumo
- __path( p : string ) : string