vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Type Aliases
  • CustomizableInitOptions
  • GitignoreFileInfo
  • IgnoreFileInfo
  • InitFileResults
  • InitOptions
  • InitSkillOptions
  • InitSkillResult
  • JSONFileInfo<T>
  • Functions
  • ensureGitignore()
  • ensureNpmignore()
  • getAuthorFromGitUser()
  • init()
  • initSkill()
  • isSkillName()
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/init
  6. /
  7. Reference

Reference

Type Aliases

CustomizableInitOptions

TypeScript
type CustomizableInitOptions = object;

Defined in: index.ts:31

Type declaration

NameType
authorstring
namestring

GitignoreFileInfo

TypeScript
type GitignoreFileInfo = IgnoreFileInfo;

Defined in: index.ts:54


IgnoreFileInfo

TypeScript
type IgnoreFileInfo = object;

Defined in: index.ts:50

Type declaration

NameType
pathstring

InitFileResults

TypeScript
type InitFileResults = object;

Defined in: index.ts:56

Type declaration

NameType
gitignore?IgnoreFileInfo
manifest?JSONFileInfo<NormalizedManifest>
npmignore?IgnoreFileInfo

InitOptions

TypeScript
type InitOptions = object;

Defined in: index.ts:20

Type declaration

NameTypeDescription
author?string-
cwd?string-
logger?(...a) => void-
packageJson?PackageJsonPackageJson instance to read and write through, so callers that share one (such as the CLI) see the written manifest in its cache.

InitSkillOptions

TypeScript
type InitSkillOptions = object;

Defined in: skill.ts:20

Type declaration

NameTypeDescription
cwd?stringthe package dir, default process.cwd()
name?stringunset: a root SKILL.md named after the package

InitSkillResult

TypeScript
type InitSkillResult = object;

Defined in: skill.ts:27

Type declaration

NameTypeDescription
exists?trueSKILL.md was already there: nothing changed
manifest?objectthe package.json and the files entry added to it
manifest.addedstring-
manifest.pathstring-
package?stringthe package.json name
skillobjectthe skill name and its SKILL.md path
skill.namestring-
skill.pathstring-

JSONFileInfo<T>

TypeScript
type JSONFileInfo<T> = object;

Defined in: index.ts:45

Type Parameters

Type ParameterDefault type
T extends JSONObjJSONObj

Type declaration

NameType
dataT
pathstring

Functions

ensureGitignore()

TypeScript
function ensureGitignore(cwd): undefined | IgnoreFileInfo

Defined in: index.ts:70

Create or update a .gitignore file ensuring node_modules is listed. Returns { path } of the file that was written, or undefined if the file already contained the entry and no changes were needed.

Parameters

ParameterType
cwdstring

Returns

undefined | IgnoreFileInfo


ensureNpmignore()

TypeScript
function ensureNpmignore(cwd): undefined | IgnoreFileInfo

Defined in: index.ts:98

Create or update a .npmignore file ensuring vlt.json is listed. Returns { path } of the file that was written, or undefined if the file already contained the entry and no changes were needed.

Parameters

ParameterType
cwdstring

Returns

undefined | IgnoreFileInfo


getAuthorFromGitUser()

TypeScript
function getAuthorFromGitUser(user?): string

Defined in: get-author-from-git-user.ts:3

Parameters

ParameterType
user?GitUser

Returns

string


init()

TypeScript
function init(__namedParameters): Promise<InitFileResults>

Defined in: index.ts:120

Parameters

ParameterType
__namedParametersInitOptions

Returns

Promise<InitFileResults>


initSkill()

TypeScript
function initSkill(__namedParameters): InitSkillResult

Defined in: skill.ts:74

Create a starter skills/<name>/SKILL.md in the package at cwd, or a root SKILL.md named after the package when no name is given. Never overwrites. Adds the skill to package.json files if it has one that doesn't cover it.

Parameters

ParameterType
__namedParametersInitSkillOptions

Returns

InitSkillResult


isSkillName()

TypeScript
function isSkillName(name): boolean

Defined in: skill.ts:17

A valid agent skill name (https://agentskills.io/specification): 1-64 lowercase letters, digits and single hyphens, no leading or trailing hyphen. Shared with skill discovery.

Parameters

ParameterType
namestring

Returns

boolean


Previous@vltpkg/initNext@vltpkg/keychain

On this page

  • Type Aliases
  • CustomizableInitOptions
  • GitignoreFileInfo
  • IgnoreFileInfo
  • InitFileResults
  • InitOptions
  • InitSkillOptions
  • InitSkillResult
  • JSONFileInfo<T>
  • Functions
  • ensureGitignore()
  • ensureNpmignore()
  • getAuthorFromGitUser()
  • init()
  • initSkill()
  • isSkillName()

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now