JSPM

lorem-pedia

0.0.4
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q22863F
    • License MIT

    Generate lorem filler from Wikipedia articles about today.

    Package Exports

    • lorem-pedia

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lorem-pedia) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Wikiday - generate lorem ipsum filler text from Wikipedia's day page.

    The results are an array of words, sentences (default) or paragraphs.

    The number of words per sentence, and the number of sentences per paragraph are configurable, and have mostly sensible defaults for the English language.

    USAGE

      // loremcli.js
        var lorem = require("wikiday"); 
        var text = new lorem(process.argv.slice(2)); 
          text.on("Ready", function(data) { 
          console.log(data); 
          process.exit(0); 
        }); 
          text.on("Usage", function(data) { 
          console.log("Usage: "); 
          console.log(data); 
          process.exit(0); 
        }); 
          text.on("TimedOut", function(data) { 
          console.error("Wikiday request timedout."); 
          console.log(typeof data); 
          process.kill(process.pid,'SIGTERM'); 
        }); 
    $ node loremcli.js -h 

    Will list the options (and built-in defaults) handled by the program.

    Options

            knownOpts: {  
                          "count" : Number 
                        , "help" : Boolean 
                        , "minWords" : Number 
                        , "maxWords" : Number 
                        , "minSentences" : Number 
                        , "maxSentences" : Number 
                        , "timeOut" : Number 
                        , "units" : [ "words", "sentences", "paragraphs" ]
                        }, 
            shortHands: { 
                           "c" : ["--count"]
                         , "?" : ["--help"]
                         , "h" : ["--help"]
                         , "maxw" : ["--maxWords"]
                         , "mins" : ["--minSentences"]
                         , "maxs" : ["--maxSentences"]
                         , "p" : ["--units", "paragraphs"]
                         , "s" : ["--units", "sentences"]
                         , "t" : ["--timeOut"]
                         , "u" : ["--units"]
                         , "w" : ["--units", "words"]
                         }, 
            defaults: {  
                          "count" : 4 
                        , "minWords" : 5 
                        , "maxWords" : 15 
                        , "minSentences" : 4 
                        , "maxSentences" : 8 
                        , "timeOut" : 5  // seconds  
                        , "units" : "sentences" 
                        }