Global Functions and Variables
Global object containing all global functions and variables.
Properties
| Qualifiers | Property | Type | Description |
|---|---|---|---|
| ejs.web | action | Namespace | Controller. Es -- Ejscript Controller class as part of the MVC framework. Also contains control helpers for views. |
| public | app | Application | Reference to the master appliction object. Will be an instance of the applications subclass of Application. |
| intrinsic const | ASC | Boolean | Conditional compilation constant. Used to disable compilation of certain elements. |
| intrinsic const | boolean | Type | Alias for the Boolean type. |
| public | config | Object | Web application configuration. This is initialized from the config *..ecf files. |
| public | CONFIG | Namespace | The CONFIG namespace used to defined conditional compilation directives. |
| intrinsic const | DEPRECATED | Boolean | Conditional compilation constant. Used to deprecate elements. |
| intrinsic const | DOC_ONLY | Boolean | Conditional compilation constant. Used to enable the compilation of elements only for creating the API documentation. |
| intrinsic const | double | Type | Alias for the Number type. |
| intrinsic const | ECMA | Boolean | Conditional compilation constant. True when running in ECMA 3.X compliant mode. |
| intrinsic const | false | Boolean | Boolean false value. |
| intrinsic const | FUTURE | Boolean | Conditional compilation constant. Used to disable compilation of certain elements. |
| intrinsic | global | Object | Global variable space reference. The global variable references an object which is the global variable space. This is useful when guaranteed access to a global variable is required. e.g. global.someName. |
| intrinsic const | Infinity | Number | Infinity value. |
| public | internal | Namespace | The internal namespace used to make entities visible within a single module only. |
| public | intrinsic | Namespace | The intrinsic namespace used for entities that are part of and intrinsic to, the Ejscript platform. |
| public | iterator | Namespace | The iterator namespace used to defined iterators. |
| intrinsic const | NaN | Number | Invalid numeric value. If the numeric type is set to an integral type, the value is zero. |
| intrinsic const | NegativeInfinity | Number | Negative infinity value. |
| intrinsic const | null | Null | Null value. The null value is returned when testing a nullable variable that has not yet had a value assigned or one that has had null explicitly assigned. |
| intrinsic const | num | Type | Alias for the Number type. |
| public | public | Namespace | The public namespace used to make entities visible accross modules. |
| intrinsic const | REGEXP | Boolean | Conditional compilation constant. Used to deprecate elements. |
| ejs.web | sessions | List of all sessions. | |
| intrinsic const | string | Type | Alias for the String type. |
| intrinsic const | TODO | Boolean | Conditional compilation constant. Used to disable compilation of certain elements. |
| intrinsic const | true | Boolean | True value. |
| intrinsic const | undefined | Void | Undefined variable value. The undefined value is returned when testing for a property that has not been defined. |
| ejs.web | view | View | Current view in the web framework. |
| intrinsic const | void | Type | Void type value. This is an alias for Void. |
Global Methods
| Qualifiers | Method |
|---|---|
| intrinsic | assert(condition: Boolean): Boolean |
| Assert a condition is true. | |
| public | basename(path: String): String |
| Get the base name of a file. | |
| intrinsic | breakpoint(): Void |
| intrinsic | cloneBase(klass: Type): Void |
| Replace the base type of a type with an exact clone. | |
| public | close(file: File, graceful: Boolean): Void |
| Close the file and free up all associated resources. | |
| public | cp(fromPath: String, toPath: String): Void |
| Copy a file. | |
| intrinsic | deserialize(obj: String): Object |
| Convert a string into an object. | |
| public | dirname(path: String): String |
| Get the directory name portion of a file. | |
| intrinsic | dump(args: Array): Void |
| Dump the contents of objects. | |
| public | exists(path: String): Boolean |
| Does a file exist. | |
| public | extension(path: String): String |
| Get the file extension portion of the file name. | |
| intrinsic | formatStack(): String |
| Format the current call stack. | |
| public | freeSpace(path: String): Number |
| Return the free space in the file system. | |
| intrinsic | hashcode(o: Object): Number |
| Get the object's Unique hash id. | |
| public | isDir(path: String): Boolean |
| Is a file a directory. | |
| public | ls(path: String, enumDirs: Boolean): Array |
| Get a list of files in a directory. | |
| public | mkdir(path: String, permissions: Number): Void |
| Make a new directory. | |
| public | mv(fromFile: String, toFile: String): Void |
| Rename a file. | |
| public | open(path: String, mode: Number, permissions: Number): File |
| Open or create a file. | |
| intrinsic | parse(input: String, preferredType: Type): Object |
| Parse a string and convert to a primitive type. | |
| ejs.db | pluralize(name: String): String |
| intrinsic | print(args: Array): Void |
| Print the arguments to the standard output with a new line appended. | |
| intrinsic | printHash(name: String, o: Object): Void |
| intrinsic | printv(args: Array): Void |
| Print variables for debugging. | |
| public | pwd(): String |
| Get the current working directory. | |
| public | read(file: File, count: Number): ByteArray |
| Read data bytes from a file and return a byte array containing the data. | |
| public | rm(path: String): Void |
| Remove a file from the file system. | |
| public | rmdir(path: String, recursive: Boolean): Void |
| Removes a directory. | |
| intrinsic | serialize(obj: Object, maxDepth: Number, all: Boolean, base: Boolean): String |
| Encode an object as a string. | |
| public | tempname(directory: String): File |
| Create a temporary file. | |
| public | write(file: File, items: Array): Number |
| Write data to the file. |
Method Detail
Assert a condition is true.
- Description
- This call tests if a condition is true by testing to see if the supplied expression is true. If the expression is false, the interpreter will throw an exception.
- Parameters
condition: Boolean JavaScript expression evaluating or castable to a Boolean result.
- Returns
- True if the condition is.
- Specified
- Ejs-11.
Get the base name of a file.
- Description
- Returns the base name portion of a file name. The base name portion is the trailing portion without any directory elements.
- Returns
- A string containing the base name portion of the file name.