Developer
Intros
How it works
API reference
File types
sjs-4
Bucket
Collection
File
Attributes
Execution
Misc
Mutation
copy
move
new
remove
rename
createComponent
detachComponent
regenerateComponent
Properties
Traversal
Injected variables
User
os
util
Modules
sjs-4e
sjs-4et
app-1
buckets-1
contextmenu-1
css-1
css-2
css-2-wrapper
html-1
image-1
markdown-1
page-1
redirect-301
sh-1
static-1
svg-1
deprecated types
File links
App interface
Hotkeys & mouse controls
Nocode editor API
Filesystem Query Language
Reserved namespaces
Filesystem interface versions
URL endpoints
URL query parameters
Turbo CSS
Blog
Developer
Intros
How it works
API reference
Turbo CSS
Blog
File types
sjs-4
Bucket
Collection
File
Attributes
Execution
Misc
Mutation
copy
move
new
remove
rename
createComponent
detachComponent
regenerateComponent
Properties
Traversal
Injected variables
User
os
util
Modules
sjs-4e
sjs-4et
app-1
buckets-1
contextmenu-1
css-1
css-2
css-2-wrapper
html-1
image-1
markdown-1
page-1
redirect-301
sh-1
static-1
svg-1
deprecated types
File links
App interface
Hotkeys & mouse controls
Nocode editor API
Filesystem Query Language
Reserved namespaces
Filesystem interface versions
URL endpoints
URL query parameters
File.prototype.createComponent()
Turn the file into a component.
Syntax
file.createComponent()
Description
Turn the file into a component.
Examples
Basic example, turn an empty file into a component.
var f = f.new(os.APPEND, "f") f.type("app-1") f.createComponent() var p = "" p += "f.path: " + f.path() + "\n" p += "f.type: " + f.type() + "\n" response.body(p)
Run