1.0.0 • Published 9 months ago

fumofumo v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

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
1.0.0

9 months ago