diff --git a/README.md b/README.md index c4f183b..484aa81 100755 --- a/README.md +++ b/README.md @@ -22,10 +22,14 @@ all these common modules and utilities into a single package, making it damn eas * You hate TypeScript * You need ultimate performance and as little overhead as possible -## New version 4 +## Major breaking changes on v4 Expresser is being rebuilt! CoffeeScript gives way to TypeScript. All-in-one gives way to only-what-you-need. -More info coming soon... +Apps using Expresser v3.x.x will most certaiinly need to be updated. + +To make the upgrade-path easier, you might use the expresser-legacy module while +you change your app's code to use the recommended replacement features. +More info here: https://github.com/igoramadas/expresser/wiki/Migration-from-v3-to-v4 ## API documentation diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 3202d7b..521adf6 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"External module","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","2097152":"Object literal"},"rows":[{"id":0,"kind":1,"name":"\"app\"","url":"modules/_app_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":256,"name":"MiddlewareDefs","url":"interfaces/_app_.middlewaredefs.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"app\""},{"id":2,"kind":1024,"name":"prepend","url":"interfaces/_app_.middlewaredefs.html#prepend","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported","parent":"\"app\".MiddlewareDefs"},{"id":3,"kind":1024,"name":"append","url":"interfaces/_app_.middlewaredefs.html#append","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported","parent":"\"app\".MiddlewareDefs"},{"id":4,"kind":128,"name":"App","url":"classes/_app_.app.html","classes":"tsd-kind-class tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"app\""},{"id":5,"kind":2048,"name":"newInstance","url":"classes/_app_.app.html#newinstance","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":6,"kind":512,"name":"constructor","url":"classes/_app_.app.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":7,"kind":1024,"name":"expressApp","url":"classes/_app_.app.html#expressapp","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":8,"kind":1024,"name":"server","url":"classes/_app_.app.html#server","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":9,"kind":1024,"name":"events","url":"classes/_app_.app.html#events","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":10,"kind":2048,"name":"init","url":"classes/_app_.app.html#init","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":11,"kind":2048,"name":"start","url":"classes/_app_.app.html#start","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":12,"kind":2048,"name":"kill","url":"classes/_app_.app.html#kill","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":13,"kind":2048,"name":"all","url":"classes/_app_.app.html#all","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":14,"kind":2048,"name":"get","url":"classes/_app_.app.html#get","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":15,"kind":2048,"name":"post","url":"classes/_app_.app.html#post","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":16,"kind":2048,"name":"put","url":"classes/_app_.app.html#put","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":17,"kind":2048,"name":"patch","url":"classes/_app_.app.html#patch","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":18,"kind":2048,"name":"delete","url":"classes/_app_.app.html#delete","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":19,"kind":2048,"name":"use","url":"classes/_app_.app.html#use","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":20,"kind":2048,"name":"route","url":"classes/_app_.app.html#route","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":21,"kind":2048,"name":"renderView","url":"classes/_app_.app.html#renderview","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":22,"kind":2048,"name":"renderText","url":"classes/_app_.app.html#rendertext","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":23,"kind":2048,"name":"renderJson","url":"classes/_app_.app.html#renderjson","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":24,"kind":2048,"name":"renderImage","url":"classes/_app_.app.html#renderimage","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":25,"kind":2048,"name":"renderError","url":"classes/_app_.app.html#rendererror","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":26,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"},{"id":27,"kind":2097152,"name":"index","url":"modules/_index_.html#index","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"\"index\""},{"id":28,"kind":32,"name":"app","url":"modules/_index_.html#index.app","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"index\".index"},{"id":29,"kind":32,"name":"version","url":"modules/_index_.html#index.version","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"index\".index"},{"id":30,"kind":1,"name":"\"logger\"","url":"modules/_logger_.html","classes":"tsd-kind-external-module"},{"id":31,"kind":128,"name":"Logger","url":"classes/_logger_.logger.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"logger\""},{"id":32,"kind":2048,"name":"argsCleaner","url":"classes/_logger_.logger.html#argscleaner","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"logger\".Logger"},{"id":33,"kind":2048,"name":"clean","url":"classes/_logger_.logger.html#clean","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"logger\".Logger"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"External module","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","2097152":"Object literal","8388608":"Event"},"rows":[{"id":0,"kind":1,"name":"\"app\"","url":"modules/_app_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":256,"name":"MiddlewareDefs","url":"interfaces/_app_.middlewaredefs.html","classes":"tsd-kind-interface tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"app\""},{"id":2,"kind":1024,"name":"prepend","url":"interfaces/_app_.middlewaredefs.html#prepend","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported","parent":"\"app\".MiddlewareDefs"},{"id":3,"kind":1024,"name":"append","url":"interfaces/_app_.middlewaredefs.html#append","classes":"tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported","parent":"\"app\".MiddlewareDefs"},{"id":4,"kind":128,"name":"App","url":"classes/_app_.app.html","classes":"tsd-kind-class tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"app\""},{"id":5,"kind":2048,"name":"newInstance","url":"classes/_app_.app.html#newinstance","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":6,"kind":512,"name":"constructor","url":"classes/_app_.app.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":7,"kind":1024,"name":"expressApp","url":"classes/_app_.app.html#expressapp","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":8,"kind":1024,"name":"server","url":"classes/_app_.app.html#server","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":9,"kind":1024,"name":"events","url":"classes/_app_.app.html#events","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":10,"kind":2048,"name":"on","url":"classes/_app_.app.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":11,"kind":2048,"name":"once","url":"classes/_app_.app.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":12,"kind":2048,"name":"off","url":"classes/_app_.app.html#off","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":13,"kind":8388608,"name":"init","url":"classes/_app_.app.html#init","classes":"tsd-kind-event tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":14,"kind":8388608,"name":"start","url":"classes/_app_.app.html#start","classes":"tsd-kind-event tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":15,"kind":8388608,"name":"kill","url":"classes/_app_.app.html#kill","classes":"tsd-kind-event tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":16,"kind":2048,"name":"all","url":"classes/_app_.app.html#all","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":17,"kind":2048,"name":"get","url":"classes/_app_.app.html#get","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":18,"kind":2048,"name":"post","url":"classes/_app_.app.html#post","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":19,"kind":2048,"name":"put","url":"classes/_app_.app.html#put","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":20,"kind":2048,"name":"patch","url":"classes/_app_.app.html#patch","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":21,"kind":2048,"name":"delete","url":"classes/_app_.app.html#delete","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":22,"kind":2048,"name":"use","url":"classes/_app_.app.html#use","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":23,"kind":2048,"name":"route","url":"classes/_app_.app.html#route","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":24,"kind":2048,"name":"renderView","url":"classes/_app_.app.html#renderview","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":25,"kind":2048,"name":"renderText","url":"classes/_app_.app.html#rendertext","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":26,"kind":2048,"name":"renderJson","url":"classes/_app_.app.html#renderjson","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":27,"kind":2048,"name":"renderImage","url":"classes/_app_.app.html#renderimage","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":28,"kind":2048,"name":"renderError","url":"classes/_app_.app.html#rendererror","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-not-exported","parent":"\"app\".App"},{"id":29,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"},{"id":30,"kind":2097152,"name":"index","url":"modules/_index_.html#index","classes":"tsd-kind-object-literal tsd-parent-kind-external-module","parent":"\"index\""},{"id":31,"kind":32,"name":"app","url":"modules/_index_.html#index.app","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"index\".index"},{"id":32,"kind":32,"name":"version","url":"modules/_index_.html#index.version","classes":"tsd-kind-variable tsd-parent-kind-object-literal","parent":"\"index\".index"},{"id":33,"kind":1,"name":"\"logger\"","url":"modules/_logger_.html","classes":"tsd-kind-external-module"},{"id":34,"kind":128,"name":"Logger","url":"classes/_logger_.logger.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"logger\""},{"id":35,"kind":2048,"name":"argsCleaner","url":"classes/_logger_.logger.html#argscleaner","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"logger\".Logger"},{"id":36,"kind":2048,"name":"clean","url":"classes/_logger_.logger.html#clean","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"logger\".Logger"}]}; \ No newline at end of file diff --git a/docs/classes/_app_.app.html b/docs/classes/_app_.app.html index 3a472db..911453f 100644 --- a/docs/classes/_app_.app.html +++ b/docs/classes/_app_.app.html @@ -92,6 +92,14 @@

Constructors

  • constructor
  • +
    +

    Events

    + +

    Properties

    @@ -137,12 +145,12 @@

    constructor

  • -

    Default App constructor. Binds the Logger clean by default for logging.

    +

    Default App constructor.

    Returns App

    @@ -150,6 +158,88 @@

    Returns +

    Events

    +
    + +

    init

    + +
      +
    • + +
      +
      +

      Init the app module and start the HTTP(S) server.

      +
      +
      +

      Parameters

      +
        +
      • +
        Optional middlewares: MiddlewareDefs
        +
        +

        List of middlewares to be appended / prepended.

        +
        +
      • +
      +

      Returns void

      +
    • +
    +
    +
    + +

    kill

    +
      +
    • kill(): void
    • +
    +
      +
    • + +
      +
      +

      Kill the underlying HTTP(S) server(s).

      +
      +
      +

      Returns void

      +
    • +
    +
    +
    + +

    start

    +
      +
    • start(): Http2Server | Http2SecureServer
    • +
    +
      +
    • + +
      +
      +

      Start the HTTP(S) server.

      +
      +
      +

      Returns Http2Server + | + Http2SecureServer +

      +

      The HTTP(S) server created by Express.

      +
    • +
    +
    +

    Properties

    @@ -158,7 +248,7 @@

    events

    events: EventEmitter = new EventEmitter()
    @@ -173,7 +263,7 @@

    expressApp

    expressApp: express.Application
    @@ -188,7 +278,7 @@

    server

    server: any
    @@ -210,7 +300,7 @@

    all

  • @@ -247,7 +337,7 @@

    delete

  • @@ -284,7 +374,7 @@

    get

  • @@ -312,29 +402,57 @@

    Returns any

  • - -

    init

    + +

    newInstance

    • -

      Init the app module and start the HTTP(S) server.

      +

      Returns a new fresh instance of the App module.

      +
      +
      +

      Returns App

      +
    • +
    +
    +
    + +

    off

    +
      +
    • off(eventName: string, callback: ListenerFn): void
    • +
    +
      +
    • + +
      +
      +

      Unbind callback from event. Shortcut to events.off().

      Parameters

      • -
        Optional middlewares: MiddlewareDefs
        +
        eventName: string
        -

        List of middlewares to be appended / prepended.

        +

        The name of the event.

        +
        +
      • +
      • +
        callback: ListenerFn
        +
        +

        Callback function.

      @@ -343,46 +461,76 @@

      Returns void

    - -

    kill

    + +

    on

      -
    • kill(): void
    • +
    • on(eventName: string, callback: ListenerFn): void
    • -

      Kill the underlying HTTP(S) server(s).

      +

      Bind callback to event. Shortcut to events.on().

      +

      Parameters

      +
        +
      • +
        eventName: string
        +
        +

        The name of the event.

        +
        +
      • +
      • +
        callback: ListenerFn
        +
        +

        Callback function.

        +
        +
      • +

      Returns void

    - -

    newInstance

    + +

    once

      -
    • newInstance(): App
    • +
    • once(eventName: string, callback: ListenerFn): void
    • -

      Returns a new fresh instance of the App module.

      +

      Bind callback to event that will be triggered only once. Shortcut to events.once().

      -

      Returns App

      +

      Parameters

      +
        +
      • +
        eventName: string
        +
        +

        The name of the event.

        +
        +
      • +
      • +
        callback: ListenerFn
        +
        +

        Callback function.

        +
        +
      • +
      +

      Returns void

    @@ -396,7 +544,7 @@

    patch

  • @@ -433,7 +581,7 @@

    post

  • @@ -470,7 +618,7 @@

    put

  • @@ -507,7 +655,7 @@

    renderError

  • @@ -564,7 +712,7 @@

    renderImage

  • @@ -621,7 +769,7 @@

    renderJson

  • @@ -670,7 +818,7 @@

    renderText

  • @@ -719,7 +867,7 @@

    renderView

  • @@ -776,7 +924,7 @@

    route

  • @@ -798,32 +946,6 @@

    Returns express.I

  • -
    - -

    start

    -
      -
    • start(): Http2Server | Http2SecureServer
    • -
    -
      -
    • - -
      -
      -

      Start the HTTP(S) server.

      -
      -
      -

      Returns Http2Server - | - Http2SecureServer -

      -

      The HTTP(S) server created by Express.

      -
    • -
    -

    use

    @@ -834,7 +956,7 @@

    use

  • @@ -890,6 +1012,15 @@

    Returns any constructor

  • +
  • + init +
  • +
  • + kill +
  • +
  • + start +
  • events
  • @@ -909,13 +1040,16 @@

    Returns anyget

  • - init + newInstance
  • - kill + off
  • - newInstance + on +
  • +
  • + once
  • patch @@ -944,9 +1078,6 @@

    Returns any route

  • -
  • - start -
  • use
  • diff --git a/docs/classes/_logger_.logger.html b/docs/classes/_logger_.logger.html index 795e6ef..2e6a5c7 100644 --- a/docs/classes/_logger_.logger.html +++ b/docs/classes/_logger_.logger.html @@ -108,7 +108,7 @@

    Static argsCleaner

  • @@ -139,7 +139,7 @@

    Static clean

  • diff --git a/docs/index.html b/docs/index.html index 1d62c73..d66f5b9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -81,9 +81,12 @@

    Look elsewhere if...

  • You hate TypeScript
  • You need ultimate performance and as little overhead as possible
  • -

    New version 4

    +

    Major breaking changes on v4

    Expresser is being rebuilt! CoffeeScript gives way to TypeScript. All-in-one gives way to only-what-you-need. - More info coming soon...

    + Apps using Expresser v3.x.x will most certaiinly need to be updated.

    +

    To make the upgrade-path easier, you might use the expresser-legacy module while + you change your app's code to use the recommended replacement features. + More info here: https://github.com/igoramadas/expresser/wiki/Migration-from-v3-to-v4

    API documentation

    You can browse the full API documentation at https://expresser.devv.com.

    diff --git a/docs/interfaces/_app_.middlewaredefs.html b/docs/interfaces/_app_.middlewaredefs.html index a84d47e..c8e3236 100644 --- a/docs/interfaces/_app_.middlewaredefs.html +++ b/docs/interfaces/_app_.middlewaredefs.html @@ -104,7 +104,7 @@

    append

    append: any | any[]
    @@ -119,7 +119,7 @@

    prepend

    prepend: any | any[]
    diff --git a/docs/modules/_index_.html b/docs/modules/_index_.html index e243a0a..b681280 100644 --- a/docs/modules/_index_.html +++ b/docs/modules/_index_.html @@ -85,7 +85,7 @@

    Let index: object

    @@ -99,7 +99,7 @@

    app

    app: any = require("./data")
    @@ -114,7 +114,7 @@

    version

    version: any = version
    diff --git a/package-lock.json b/package-lock.json index 4dbf6d0..ffae7f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expresser", - "version": "3.9.0", + "version": "4.0.0-alpha.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -265,9 +265,9 @@ "dev": true }, "@types/node": { - "version": "11.13.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.4.tgz", - "integrity": "sha512-+rabAZZ3Yn7tF/XPGHupKIL5EcAbrLxnTr/hgQICxbeuAfWtT0UZSfULE+ndusckBItcv4o6ZeOJplQikVcLvQ==", + "version": "11.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.5.tgz", + "integrity": "sha512-/OMMBnjVtDuwX1tg2pkYVSqRIDSmNTnvVvmvP/2xiMAAWf4a5+JozrApCrO4WCAILmXVxfNoQ3E+0HJbNpFVGg==", "dev": true }, "@types/range-parser": { diff --git a/package.json b/package.json index f91bbde..a6d98fa 100755 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/express": "^4.16.1", - "@types/node": "^11.13.4", + "@types/node": "^11.13.5", "body-parser": "^1.18.3", "chai": "^4.2.0", "compression": "^1.7.4",