PageSourceSearch

https://ohmyposh.dev/assets/js/911ed886.182df70d.js

js ohmyposh.dev collected 2026-10-02 04:47:19 UTC 11,293 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8445],{6920(e,n,t){t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>j,frontMatter:()=>l,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"segments/languages/node","title":"Node","description":"What","source":"@site/docs/segments/languages/node.mdx","sourceDirName":"segments/languages","slug":"/segments/languages/node","permalink":"/docs/segments/languages/node","draft":false,"unlisted":false,"editUrl":"https://github.com/jandedobbeleer/oh-my-posh/edit/main/website/docs/segments/languages/node.mdx","tags":[],"version":"current","frontMatter":{"id":"node","title":"Node","sidebar_label":"Node"},"sidebar":"docs","previous":{"title":"Nim","permalink":"/docs/segments/languages/nim"},"next":{"title":"Ocaml","permalink":"/docs/segments/languages/ocaml"}}');var d=t(4848),i=t(8453),r=t(6674);const l={id:"node",title:"Node",sidebar_label:"Node"},c=void 0,h={},o=[{value:"What",id:"what",level:2},{value:"Sample Configuration",id:"sample-configuration",level:2},{value:"Options",id:"options",level:2},{value:"Template (info)",id:"template-info",level:2},{value:"Properties",id:"properties",level:3}];function x(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h2,{id:"what",children:"What"}),"\n",(0,d.jsxs)(n.p,{children:["Display the currently active ",(0,d.jsx)(n.a,{href:"https://nodejs.org",children:"Node.js"})," version."]}),"\n",(0,d.jsx)(n.h2,{id:"sample-configuration",children:"Sample Configuration"}),"\n","\n",(0,d.jsx)(r.A,{data:{type:"node",style:"powerline",powerline_symbol:"\ue0b0",foreground:"#ffffff",background:"#6CA35E",template:" \ue718 {{ .Full }} "}}),"\n",(0,d.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Name"}),(0,d.jsx)(n.th,{style:{textAlign:"center"},children:"Type"}),(0,d.jsx)(n.th,{style:{textAlign:"center"},children:"Default"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"home_enabled"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"boolean"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"false"})}),(0,d.jsx)(n.td,{children:"display the segment in the HOME folder or not"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"cache_duration"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"none"})}),(0,d.jsxs)(n.td,{children:["the duration for which the version will be cached. The duration is a string in the format ",(0,d.jsx)(n.code,{children:"1h2m3s"})," and is parsed using the ",(0,d.jsx)(n.a,{href:"https://golang.org/pkg/time/#ParseDuration",children:"time.ParseDuration"})," function from the Go standard library. To disable the cache, use ",(0,d.jsx)(n.code,{children:"none"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"missing_command_text"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"}}),(0,d.jsx)(n.td,{children:"text to display when the command is missing"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"display_mode"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"context"})}),(0,d.jsx)(n.td,{children:(0,d.jsxs)("ul",{children:[(0,d.jsxs)("li",{children:[(0,d.jsx)(n.code,{children:"always"}),": the segment is always displayed"]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(n.code,{children:"files"}),": the segment is only displayed when file ",(0,d.jsx)(n.code,{children:"extensions"})," listed are present"]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(n.code,{children:"context"}),": displays the segment when the environment or files is active"]})]})})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"version_url_template"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"}}),(0,d.jsxs)(n.td,{children:["a go ",(0,d.jsx)(n.a,{href:"https://golang.org/pkg/text/template/",children:"text/template"})," ",(0,d.jsx)(n.a,{href:"/docs/configuration/templates",children:"template"})," that creates the URL of the version info / release notes"]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"fetch_package_manager"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"boolean"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"false"})}),(0,d.jsx)(n.td,{children:"define if the current project uses PNPM, Yarn, or NPM"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"pnpm_icon"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"\\ue865"})}),(0,d.jsx)(n.td,{children:"the icon/text to display when using P
1NPM"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"yarn_icon"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"\\ue6a7"})}),(0,d.jsx)(n.td,{children:"the icon/text to display when using Yarn"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"npm_icon"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"\\uE71E"})}),(0,d.jsx)(n.td,{children:"the icon/text to display when using NPM"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"bun_icon"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"\\ue76f"})}),(0,d.jsx)(n.td,{children:"the icon/text to display when using Bun"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"extensions"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"[]string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"*.js, *.ts, package.json, .nvmrc, pnpm-workspace.yaml, .pnpmfile.cjs, .vue"})}),(0,d.jsx)(n.td,{children:"allows to override the default list of file extensions to validate"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"folders"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"[]string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"}}),(0,d.jsx)(n.td,{children:"allows to override the list of folder names to validate"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"tooling"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"[]string"})}),(0,d.jsx)(n.td,{style:{textAlign:"center"},children:(0,d.jsx)(n.code,{children:"node"})}),(0,d.jsx)(n.td,{children:"the tooling to use for fetching the version"})]})]})]}),"\n",(0,d.jsxs)(n.h2,{id:"template-info",children:["Template (",(0,d.jsx)(n.a,{href:"/docs/configuration/templates",children:"info"}),")"]}),"\n",(0,d.jsx)(n.admonition,{title:"default template",type:"note",children:(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-template",children:"{{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}\n"})})}),"\n",(0,d.jsx)(n.h3,{id:"properties",children:"Properties"}),"\n",(0,d.jsxs)(n.table,{children:[(0,d.jsx)(n.thead,{children:(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.th,{children:"Name"}),(0,d.jsx)(n.th,{children:"Type"}),(0,d.jsx)(n.th,{children:"Description"})]})}),(0,d.jsxs)(n.tbody,{children:[(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Full"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:"the full version"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Major"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:"major number"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Minor"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:"minor number"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Patch"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:"patch number"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".URL"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:"URL of the version info / release notes"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Error"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsx)(n.td,{children:"error encountered when fetching the version string"})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".PackageManagerName"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsxs)(n.td,{children:["the package manager name (",(0,d.jsx)(n.code,{children:"bun"}),", ",(0,d.jsx)(n.code,{children:"npm"}),", ",(0,d.jsx)(n.code,{children:"yarn"})," or ",(0,d.jsx)(n.code,{children:"pnpm"}),") when setting ",(0,d.jsx)(n.code,{children:"fetch_package_manager"})," to ",(0,d.jsx)(n.code,{children:"true"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".PackageManagerIcon"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsxs)(n.td,{children:["the PNPM, Yarn, Bun, or NPM icon when setting ",(0,d.jsx)(n.code,{children:"fetch_package_manager"})," to ",(0,d.jsx)(n.code,{children:"true"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Mismatch"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"boolean"})}),(0,d.jsxs)(n.td,{children:["true if the version in ",(0,d.jsx)(n.code,{children:".nvmrc"})," is not equal to ",(0,d.jsx)(n.code,{children:".Full"})]})]}),(0,d.jsxs)(n.tr,{children:[(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:".Expected"})}),(0,d.jsx)(n.td,{children:(0,d.jsx)(n.code,{children:"string"})}),(0,d.jsxs)(n.td,{children:["the expected version set in ",(0,d.jsx)(n.code,{children:".nvmrc"})]})]})]})]})]})}function j(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(x,{...e})}):x(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.