nodejs
A Nodejs module for managing package, oci image, static website, running run script ...
Installation
dagger install github.com/Dudesons/daggerverse/nodejs@v0.8.0Entrypoint
Return Type
Nodejs Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
func (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
)@func()
example(): Nodejs {
return dag
.nodejs()
}Types
Nodejs 🔗
build() 🔗
Execute the build command
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| captureOutput | Boolean | false | Indicate if we want to capture in /outputs the stdout + exit code in order to extract the folder |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
buildfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Build()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.build()
)@func()
example(): Nodejs {
return dag
.nodejs()
.build()
}bumpVersion() 🔗
Bump the package version
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| strategy | String ! | - | Define the bump version strategy (major | minor | patch | premajor | preminor | prepatch | prerelease) |
| message | String | - | The message will use it as a commit message when creating a version commit. If the message config contains %s then that will be replaced with the resulting version number |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
bump-version --strategy stringfunc (m *MyModule) Example(strategy string) *dagger.Nodejs {
return dag.
Nodejs().
Bumpversion(strategy)
}@function
def example(strategy: str) -> dagger.Nodejs:
return (
dag.nodejs()
.bumpversion(strategy)
)@func()
example(strategy: string): Nodejs {
return dag
.nodejs()
.bumpVersion(strategy)
}clean() 🔗
Execute clean command
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| captureOutput | Boolean | false | Indicate if we want to capture in /outputs the stdout + exit code in order to extract the folder |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
cleanfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Clean()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.clean()
)@func()
example(): Nodejs {
return dag
.nodejs()
.clean()
}container() 🔗
Return the current container state
Return Type
Container ! Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Nodejs().
Container()
}@function
def example() -> dagger.Container:
return (
dag.nodejs()
.container()
)@func()
example(): Container {
return dag
.nodejs()
.container()
}directory() 🔗
Return a directory by default the current working directory
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String | - | Define permission on the package in the registry |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
directoryfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Nodejs().
Directory()
}@function
def example() -> dagger.Directory:
return (
dag.nodejs()
.directory()
)@func()
example(): Directory {
return dag
.nodejs()
.directory()
}do() 🔗
Execute all commands
Return Type
String ! Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
dofunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Nodejs().
Do(ctx)
}@function
async def example() -> str:
return await (
dag.nodejs()
.do()
)@func()
async example(): Promise<string> {
return dag
.nodejs()
.do()
}install() 🔗
Install node modules
Return Type
Nodejs ! Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
installfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Install()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.install()
)@func()
example(): Nodejs {
return dag
.nodejs()
.install()
}lint() 🔗
Execute lint command
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| captureOutput | Boolean | false | Indicate if we want to capture in /outputs the stdout + exit code in order to extract the folder |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
lintfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Lint()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.lint()
)@func()
example(): Nodejs {
return dag
.nodejs()
.lint()
}ociBuild() 🔗
Build a production image and push to one or more registries
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| fileContainerArtifacts | [String ! ] | - | Define path to fo file to fetch from the build container |
| directoryContainerArtifacts | [String ! ] | - | Define path to fo directories to fetch from the build container |
| registries | [String ! ] ! | - | Define registries where to push the image |
| isTtl | Boolean | - | Define the ttl registry to use |
| ttlRegistry | String | "ttl.sh" | Define the ttl registry to use |
| ttl | String | "60m" | Define the ttl in the ttl registry |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
oci-build --registries string1 --registries string2func (m *MyModule) Example(ctx context.Context, registries []string) []string {
return dag.
Nodejs().
Ocibuild(ctxregistries)
}@function
async def example(registries: List[str]) -> List[str]:
return await (
dag.nodejs()
.ocibuild(registries)
)@func()
async example(registries: string[]): Promise<string[]> {
return dag
.nodejs()
.ociBuild(registries)
}parallelTest() 🔗
Execute test commands in parallel
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| cmds | [List ! ] ! | - | No description provided |
| captureOutput | Boolean | false | Indicate if we want to capture in /outputs the stdout + exit code in order to extract the folder |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
parallel-test --cmds list1 --cmds list2func (m *MyModule) Example(ctx context.Context, cmds []) {
return dag.
Nodejs().
Paralleltest(ctx, cmds)
}@function
async def example(cmds: List[]) -> None:
return await (
dag.nodejs()
.paralleltest(cmds)
)@func()
async example(cmds: []): Promise<void> {
return dag
.nodejs()
.parallelTest(cmds)
}pipeline() 🔗
Execute the whole pipeline in general used with the function ‘with-auto-setup’
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| preHooks | [List ! ] | - | Define hooks to execute before all |
| postHooks | [List ! ] | - | Define hooks to execute after tests and before build |
| isOci | Boolean | - | Indicate if the artifact is an oci build or not |
| dryRun | Boolean | "false" | Indicate to dry run the publishing |
| packageAccess | String | "true" | Define permission on the package in the registry |
| packageDevTag | String | - | Indicate if the package is publishing as development version |
| fileContainerArtifacts | [String ! ] | - | Define path to file to fetch from the build container |
| directoryContainerArtifacts | [String ! ] | - | Define path to directories to fetch from the build container |
| ociRegistries | [String ! ] | - | Define registries where to push the image |
| ttlRegistry | String | "ttl.sh" | Define the ttl registry to use |
| ttl | String | "60m" | Define the ttl in the ttl registry |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
pipelinefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Nodejs().
Pipeline(ctx)
}@function
async def example() -> str:
return await (
dag.nodejs()
.pipeline()
)@func()
async example(): Promise<string> {
return dag
.nodejs()
.pipeline()
}production() 🔗
Return a node container with the ‘NODE_ENV’ set to production
Return Type
Nodejs ! Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
productionfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Production()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.production()
)@func()
example(): Nodejs {
return dag
.nodejs()
.production()
}publish() 🔗
Execute the publish which push a package to a registry
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| access | String | - | Define permission on the package in the registry |
| devTag | String | - | Indicate if the package is publishing as development version |
| dryRun | Boolean | - | Indicate to dry run the publishing |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
publishfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Publish()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.publish()
)@func()
example(): Nodejs {
return dag
.nodejs()
.publish()
}run() 🔗
Execute a command from the package.json
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| command | [String ! ] ! | - | Command from the package.json to run |
| captureOutput | Boolean ! | - | Indicate if we want to capture in /outputs the stdout + exit code in order to extract the folder |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
run --command string1 --command string2 --capture-output booleanfunc (m *MyModule) Example(command []string, captureOutput bool) *dagger.Nodejs {
return dag.
Nodejs().
Run(command, captureOutput)
}@function
def example(command: List[str], captureoutput: bool) -> dagger.Nodejs:
return (
dag.nodejs()
.run(command, captureoutput)
)@func()
example(command: string[], captureOutput: boolean): Nodejs {
return dag
.nodejs()
.run(command, captureOutput)
}serve() 🔗
Expose the container as a service
Return Type
Service ! Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
servefunc (m *MyModule) Example() *dagger.Service {
return dag.
Nodejs().
Serve()
}@function
def example() -> dagger.Service:
return (
dag.nodejs()
.serve()
)@func()
example(): Service {
return dag
.nodejs()
.serve()
}setupSystem() 🔗
Setup system component like installing packages
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| systemSetupCmds | [List ! ] | - | Indicate attempted system package to install |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
setup-systemfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Setupsystem()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.setupsystem()
)@func()
example(): Nodejs {
return dag
.nodejs()
.setupSystem()
}shell() 🔗
Open a shell in the current container or execute a command inside it, like node
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| cmd | [String ! ] | - | The command to execute in the terminal |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
shellfunc (m *MyModule) Example() *dagger.Container {
return dag.
Nodejs().
Shell()
}@function
def example() -> dagger.Container:
return (
dag.nodejs()
.shell()
)@func()
example(): Container {
return dag
.nodejs()
.shell()
}test() 🔗
Execute test command
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| captureOutput | Boolean | false | Indicate if we want to capture in /outputs the stdout + exit code in order to extract the folder |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
testfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Test()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.test()
)@func()
example(): Nodejs {
return dag
.nodejs()
.test()
}withAutoSetup() 🔗
Allow to let the pipeline to be setup automatically based on the package.json aka lazy mode
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| pipelineId | String ! | - | A name to use in the pipeline and injected in cache keys |
| src | Directory ! | - | The code to mount in the node container |
| patternExclusions | [String ! ] | - | Patterns to exclude in the analysis for the auto-detection |
| image | String | "node" | The image name to use |
| isAlpine | Boolean | "true" | Define if the image to use is an alpine or not |
| containerPlatform | Scalar | "linux/amd64" | Container options |
| systemSetupCmds | [List ! ] | - | Indicate attempted system package to install |
| packageManagerVersion | String | - | Define a specific version of the package manager. |
| workspaces | [String ! ] | - | Nodejs workspaces to use during the pipeline |
| internalImage | String | "alpine:latest" | Used for autodiscovery to overwrite the default image used for internal action (mainly used to avoid rate limit with dockerhub) |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-auto-setup --pipeline-id string --src DIR_PATHfunc (m *MyModule) Example(pipelineId string, src *dagger.Directory) *dagger.Nodejs {
return dag.
Nodejs().
Withautosetup(pipelineId, src)
}@function
def example(pipelineid: str, src: dagger.Directory) -> dagger.Nodejs:
return (
dag.nodejs()
.withautosetup(pipelineid, src)
)@func()
example(pipelineId: string, src: Directory): Nodejs {
return dag
.nodejs()
.withAutoSetup(pipelineId, src)
}withCache() 🔗
Return the Nodejs container with an additional cache volume in the working dir
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| cache | CacheVolume ! | - | The cache volume to use |
| path | String ! | - | The path where the cache volume should be mounted |
| persisted | Boolean | - | Indicate if the cache volume is mounted or persisted in the container |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-cache --cache VOLUME_NAME --path stringfunc (m *MyModule) Example(cache *dagger.CacheVolume, path string) *dagger.Nodejs {
return dag.
Nodejs().
Withcache(cache, path)
}@function
def example(cache: dagger.CacheVolume, path: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withcache(cache, path)
)@func()
example(cache: CacheVolume, path: string): Nodejs {
return dag
.nodejs()
.withCache(cache, path)
}withDirectory() 🔗
Return the Nodejs container with an additional directory in the working dir
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| dir | Directory ! | - | The directory to use |
| path | String ! | - | The path where the directory should be mounted |
| persisted | Boolean | - | Indicate if the directory is mounted or persisted in the container |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-directory --dir DIR_PATH --path stringfunc (m *MyModule) Example(dir *dagger.Directory, path string) *dagger.Nodejs {
return dag.
Nodejs().
Withdirectory(dir, path)
}@function
def example(dir: dagger.Directory, path: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withdirectory(dir, path)
)@func()
example(dir: Directory, path: string): Nodejs {
return dag
.nodejs()
.withDirectory(dir, path)
}withDotEnv() 🔗
Add a new environment variable for the container
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| data | Secret ! | - | Dotenv format data to inject as environment variables as secret |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-dot-env --data env:MYSECRETfunc (m *MyModule) Example(data *dagger.Secret) *dagger.Nodejs {
return dag.
Nodejs().
Withdotenv(data)
}@function
def example(data: dagger.Secret) -> dagger.Nodejs:
return (
dag.nodejs()
.withdotenv(data)
)@func()
example(data: Secret): Nodejs {
return dag
.nodejs()
.withDotEnv(data)
}withEnvVar() 🔗
Add a new environment variable for the container
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| value | String | - | Indicate the value of the env var |
| secret | Secret | - | Indicate the env var is a secret with this value |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-env-var --name stringfunc (m *MyModule) Example(name string) *dagger.Nodejs {
return dag.
Nodejs().
Withenvvar(name)
}@function
def example(name: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withenvvar(name)
)@func()
example(name: string): Nodejs {
return dag
.nodejs()
.withEnvVar(name)
}withFile() 🔗
Return the Nodejs container with an additional file in the working dir
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| file | File ! | - | The file to use |
| path | String ! | - | The path where the file should be mounted |
| persisted | Boolean | - | Indicate if the file is mounted or persisted in the container |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-file --file file:path --path stringfunc (m *MyModule) Example(file *dagger.File, path string) *dagger.Nodejs {
return dag.
Nodejs().
Withfile(file, path)
}@function
def example(file: dagger.File, path: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withfile(file, path)
)@func()
example(file: File, path: string): Nodejs {
return dag
.nodejs()
.withFile(file, path)
}withNpm() 🔗
Return the Nodejs container with npm setup as an entrypoint and npm cache setup
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| disableCache | Boolean | - | Disable mounting cache volumes. |
| version | String | - | Define a specific version of npm. |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-npmfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Withnpm()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.withnpm()
)@func()
example(): Nodejs {
return dag
.nodejs()
.withNpm()
}withNpmrcTokenEnv() 🔗
Return the Nodejs container with an environment variable to use in your npmrc file
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | The name of the environment variable where the npmrc token is stored |
| value | Secret ! | - | The value of the token |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-npmrc-token-env --name string --value env:MYSECRETfunc (m *MyModule) Example(name string, value *dagger.Secret) *dagger.Nodejs {
return dag.
Nodejs().
Withnpmrctokenenv(name, value)
}@function
def example(name: str, value: dagger.Secret) -> dagger.Nodejs:
return (
dag.nodejs()
.withnpmrctokenenv(name, value)
)@func()
example(name: string, value: Secret): Nodejs {
return dag
.nodejs()
.withNpmrcTokenEnv(name, value)
}withNpmrcTokenFile() 🔗
Return the Nodejs container with npmrc file
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| npmrcFile | Secret ! | - | The npmrc file to inject in the container |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-npmrc-token-file --npmrc-file env:MYSECRETfunc (m *MyModule) Example(npmrcFile *dagger.Secret) *dagger.Nodejs {
return dag.
Nodejs().
Withnpmrctokenfile(npmrcFile)
}@function
def example(npmrcfile: dagger.Secret) -> dagger.Nodejs:
return (
dag.nodejs()
.withnpmrctokenfile(npmrcfile)
)@func()
example(npmrcFile: Secret): Nodejs {
return dag
.nodejs()
.withNpmrcTokenFile(npmrcFile)
}withPackageManager() 🔗
Return the Nodejs container setup with the right package manager and optionaly cache setup
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| packageManager | String ! | - | The package manager to use |
| disableCache | Boolean | - | Disable mounting cache volumes. |
| version | String | - | Define a specific version of the package manager. |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-package-manager --package-manager stringfunc (m *MyModule) Example(packageManager string) *dagger.Nodejs {
return dag.
Nodejs().
Withpackagemanager(packageManager)
}@function
def example(packagemanager: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withpackagemanager(packagemanager)
)@func()
example(packageManager: string): Nodejs {
return dag
.nodejs()
.withPackageManager(packageManager)
}withPipelineId() 🔗
Define the pipeline id to use
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| pipelineId | String ! | - | The name to give to the pipeline |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-pipeline-id --pipeline-id stringfunc (m *MyModule) Example(pipelineId string) *dagger.Nodejs {
return dag.
Nodejs().
Withpipelineid(pipelineId)
}@function
def example(pipelineid: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withpipelineid(pipelineid)
)@func()
example(pipelineId: string): Nodejs {
return dag
.nodejs()
.withPipelineId(pipelineId)
}withSource() 🔗
Return the Nodejs container with the source code, ‘node_modules’ cache set up and workdir set
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | The source code |
| persisted | Boolean | - | Indicate if the directory is mounted or persisted in the container |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-source --src DIR_PATHfunc (m *MyModule) Example(src *dagger.Directory) *dagger.Nodejs {
return dag.
Nodejs().
Withsource(src)
}@function
def example(src: dagger.Directory) -> dagger.Nodejs:
return (
dag.nodejs()
.withsource(src)
)@func()
example(src: Directory): Nodejs {
return dag
.nodejs()
.withSource(src)
}withVersion() 🔗
Return the Nodejs container with the right base image
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String | "node" | The image name to use |
| version | String ! | - | The version of the image to use |
| isAlpine | Boolean | "true" | Define if the image to use is an alpine or not |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-version --version stringfunc (m *MyModule) Example(version string) *dagger.Nodejs {
return dag.
Nodejs().
Withversion(version)
}@function
def example(version: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withversion(version)
)@func()
example(version: string): Nodejs {
return dag
.nodejs()
.withVersion(version)
}withWorkspace() 🔗
Prepare the command to inject workspaces
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| workspace | String ! | - | No description provided |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-workspace --workspace stringfunc (m *MyModule) Example(workspace string) *dagger.Nodejs {
return dag.
Nodejs().
Withworkspace(workspace)
}@function
def example(workspace: str) -> dagger.Nodejs:
return (
dag.nodejs()
.withworkspace(workspace)
)@func()
example(workspace: string): Nodejs {
return dag
.nodejs()
.withWorkspace(workspace)
}withYarn() 🔗
Return the Nodejs container with yarn setup as an entrypoint and yarn cache setup
Return Type
Nodejs !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| disableCache | Boolean | - | Disable mounting cache volumes. |
| version | String | - | Define a specific version of npm. |
Example
dagger -m github.com/Dudesons/daggerverse/nodejs@20025a28c86e11511da0c8b23b8701c85b6b1e50 call \
with-yarnfunc (m *MyModule) Example() *dagger.Nodejs {
return dag.
Nodejs().
Withyarn()
}@function
def example() -> dagger.Nodejs:
return (
dag.nodejs()
.withyarn()
)@func()
example(): Nodejs {
return dag
.nodejs()
.withYarn()
}