Effect
Source: src/jix/effect.js#L163-308
Core class representing a jix effect. Effects are the fundamental building blocks in Jix that describe actions to build, install, and uninstall configurations.
Type Definitions
EffectFn
Source: src/jix/effect.js#L97
A function that returns an Effect.
Type: () => Effect
EffectOrFn
Source: src/jix/effect.js#L101
An Effect or a function that returns an Effect.
Type: Effect | EffectFn
new Effect(props)
Parameters:
props(Object, optional) - Effect propertiesinstall(Array, optional) - Install action specificationuninstall(Array, optional) - Uninstall action specificationbuild(Array, optional) - Build action specificationdependencies(Array, optional) - Array of Effect dependenciespath(string, optional) - File system path for the effectstr(string, optional) - String representationhash(string, optional) - Pre-computed hash (usually auto-generated)
Properties
dependencies(Effect[]) - Array of dependenciesinstall(Array) - Install action specificationuninstall(Array) - Uninstall action specificationbuild(Array) - Build action specificationhost(string) - Target host machine IDuser(string) - Target user namehash(string) - Content hash of the effectpath(string) - Associated file system pathstr(string) - Associated string (defaults topath)
symlinkTo(path)
Source: src/jix/effect.js#L298
Create a symbolic link to this effect at the specified path.
Parameters:
path(string) - Destination path for the symbolic link
Returns: Effect
linkTo(path)
Source: src/jix/effect.js#L303
Create a hard link to this effect at the specified path.
Parameters:
path(string) - Destination path for the link
Returns: Effect
copyTo(path)
Source: src/jix/effect.js#L308
Copy this effect to the specified path.
Parameters:
path(string) - Destination path for the copy
Returns: Effect
normalize()
Returns normalized representation of the effect for hashing.
Returns: Object with install, uninstall, build, dependencies, host, and user
serialize()
Serialize the effect to JSON string.
Returns: string
toString()
Returns the string representation of the effect.
Returns: string (same as str property)
Notes
- Effects are automatically tracked when created within a target context
- The hash is computed from the normalized representation
- Use the
effect()function (from the main API) to create effects rather than instantiating directly