FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.getPath() function

string fcf.getPath(string a_uri, string a_aliases, boolean a_innerServerPath = fcf.isServer())
string fcf.getPath(string a_uri, boolean a_innerServerPath = fcf.isServer())

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Translates a relative URI in FCF notation into a real resource path

If the path is given in FCF notation, then the real path to the resource is returned. If a valid path to the resource is passed, then its normalized version is returned (using the fcf.normalizePath() function). You can read more about the rules for compiling a path in the section: "Paths to resources"

Arguments

string a_uri
- Source path.

object a_aliases
- Aliases object. The alias is the key and the value is the path.

boolean a_innerServerPath = fcf.isServer()
- If true then a_path contains the path on the server, otherwise a_path is the network address
Result
string
- Real resource address

Example: Applying a function on the server side

{ let result = fcf.getPath("fcf-framework-core:"); console.log(result); } { let result = fcf.getPath("fcf-framework-core:fcf.js"); console.log(result); } { let result = fcf.getPath("index.js"); console.log(result); }

Output:

/home/user/development/project/node_modules/fcf-framework-core /home/user/development/project/node_modules/fcf-framework-core/fcf.js /home/user/development/project/index.js