Home Reference Source

Function

Static Public Summary
public

afterStart(PAW_GLOBAL: *, cb: *)

public

assetsToArray(assets: *): Array

Return assets as array

public

beforeStart(serverConfig: *, PAW_GLOBAL: *, cb: *)

public

generateMeta(data: *, options: *): Array

Return array of meta tags required for the route Pass seo data to the function and get array of meta data

public

generateStringHash(str: *, namespace: *): string

Simple numeric hash of a string, used for non-secure usage only

public

Get text from html string

public

Check if current script is running in browser or not

public

loadScript(path: *, attributes: *): Promise

Load javascript file by path

public

loadStyle(path: *): Promise

Load stylesheet

public

server(req: *, res: *, next: *, PAW_GLOBAL: *): *

Export this a middleware export.

public

trimTillLastSentence(str: *, length: *): *

Process string to get appropriate trimmed data Thus string "Tirth Bodawala" should return "Tirth Bodawala" with length 14 & should return "Tirth" with length 13, first it tries to search for "." and then for " "(space)

Static Public

public afterStart(PAW_GLOBAL: *, cb: *) source

import {afterStart} from '@pawjs/pawjs/src/server/server.js'

Params:

NameTypeAttributeDescription
PAW_GLOBAL *
cb *
  • optional

public assetsToArray(assets: *): Array source

import {assetsToArray} from '@pawjs/pawjs/src/utils/utils.js'

Return assets as array

Params:

NameTypeAttributeDescription
assets *

Return:

Array

public beforeStart(serverConfig: *, PAW_GLOBAL: *, cb: *) source

import {beforeStart} from '@pawjs/pawjs/src/server/server.js'

Params:

NameTypeAttributeDescription
serverConfig *
PAW_GLOBAL *
cb *
  • optional

public generateMeta(data: *, options: *): Array source

import {generateMeta} from '@pawjs/pawjs/src/utils/seo.js'

Return array of meta tags required for the route Pass seo data to the function and get array of meta data

Params:

NameTypeAttributeDescription
data *
options *

Return:

Array

public generateStringHash(str: *, namespace: *): string source

import {generateStringHash} from '@pawjs/pawjs/src/utils/utils.js'

Simple numeric hash of a string, used for non-secure usage only

Params:

NameTypeAttributeDescription
str *
namespace *

Return:

string

public getTextFromHtml(str: *): string source

import {getTextFromHtml} from '@pawjs/pawjs/src/utils/seo.js'

Get text from html string

Params:

NameTypeAttributeDescription
str *

Return:

string

public isBrowser(): boolean source

import {isBrowser} from '@pawjs/pawjs/src/utils/utils.js'

Check if current script is running in browser or not

Return:

boolean

public loadScript(path: *, attributes: *): Promise source

import {loadScript} from '@pawjs/pawjs/src/utils/utils.js'

Load javascript file by path

Params:

NameTypeAttributeDescription
path *
attributes *

Return:

Promise

public loadStyle(path: *): Promise source

import {loadStyle} from '@pawjs/pawjs/src/utils/utils.js'

Load stylesheet

Params:

NameTypeAttributeDescription
path *

Return:

Promise

public server(req: *, res: *, next: *, PAW_GLOBAL: *): * source

Export this a middleware export.

Params:

NameTypeAttributeDescription
req *
res *
next *
PAW_GLOBAL *

Return:

*

public trimTillLastSentence(str: *, length: *): * source

import {trimTillLastSentence} from '@pawjs/pawjs/src/utils/seo.js'

Process string to get appropriate trimmed data Thus string "Tirth Bodawala" should return "Tirth Bodawala" with length 14 & should return "Tirth" with length 13, first it tries to search for "." and then for " "(space)

Params:

NameTypeAttributeDescription
str *
length *

Return:

*

String