403Webshell
Server IP : 198.54.126.161  /  Your IP : 216.73.216.232
Web Server : LiteSpeed
System : Linux premium12.web-hosting.com 4.18.0-553.94.1.lve.el8.x86_64 #1 SMP Thu Jan 22 12:37:22 UTC 2026 x86_64
User : amerfigf ( 898)
PHP Version : 8.2.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/thread-self/root/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/scripts/docs-build.js
#!/opt/alt/alt-nodejs14/root/usr/bin/node

var fs = require('fs')
var marked = require('marked-man')
var npm = require('../lib/npm.js')
var args = process.argv.slice(2)
var src = args[0]
var dest = args[1] || src

fs.readFile(src, 'utf8', function (err, data) {
  if (err) return console.log(err)

  function frontmatter (match, p1) {
    const fm = { }

    p1.split(/\r?\n/).forEach((kv) => {
      let result = kv.match(/^([^\s:]+):\s*(.*)/)
      if (result) {
        fm[result[1]] = result[2]
      }
    })

    return `# ${fm['title']}(${fm['section']}) - ${fm['description']}`
  }

  function replacer (match, p1) {
    return 'npm help ' + p1.replace(/npm /, '')
  }

  var result = data.replace(/@VERSION@/g, npm.version)
    .replace(/^---\n([\s\S]+\n)---/, frontmatter)
    .replace(/\[([^\]]+)\]\(\/commands\/([^)]+)\)/g, replacer)
    .replace(/\[([^\]]+)\]\(\/configuring-npm\/([^)]+)\)/g, replacer)
    .replace(/\[([^\]]+)\]\(\/using-npm\/([^)]+)\)/g, replacer)
    .trim()

  fs.writeFile(dest, marked(result), 'utf8', function (err) {
    if (err) return console.log(err)
  })
})

Youez - 2016 - github.com/yon3zu
LinuXploit