Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.216.250
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
node-yargs /
Delete
Unzip
Name
Size
Permission
Date
Action
examples
[ DIR ]
drwxr-xr-x
2023-12-23 20:12
CHANGELOG-historical.md.gz
28.74
KB
-rw-r--r--
2020-12-05 23:07
CODE_OF_CONDUCT.md
3.14
KB
-rw-r--r--
2020-12-05 23:07
README.md.gz
2.26
KB
-rw-r--r--
2020-12-05 23:07
advanced.md.gz
5.58
KB
-rw-r--r--
2020-12-05 23:07
api.md.gz
15
KB
-rw-r--r--
2020-12-05 23:07
browser.md
781
B
-rw-r--r--
2020-12-05 23:07
bundling.md
1.44
KB
-rw-r--r--
2020-12-05 23:07
changelog.Debian.gz
939
B
-rw-r--r--
2022-12-01 14:49
contributing.md
1.04
KB
-rw-r--r--
2020-12-05 23:07
copyright
1.71
KB
-rw-r--r--
2022-12-01 14:17
examples.md.gz
2.05
KB
-rw-r--r--
2020-12-05 23:07
tricks.md
2.21
KB
-rw-r--r--
2020-12-05 23:07
typescript.md
1.44
KB
-rw-r--r--
2020-12-05 23:07
Save
Rename
## Bundling yargs This document outlines how to bundle your libraries that use yargs into standalone distributions. ### You might not need to bundle Newer releases of yargs can run directly in modern browsers, take a look at [Running yargs in the browser](https://github.com/yargs/yargs/blob/master/docs/browser.md). ## ncc If you are targeting Node.js with your bundle, we recommend using [`@vercel/ncc`](https://www.npmjs.com/package/@vercel/ncc). Given a CommonJS file, **index.js**: ```js const yargs = require('yargs/yargs') const chalk = require('chalk') require('yargs/yargs')(process.argv.slice(2)) .option('awesome-opt', { describe: `my awesome ${chalk.green('option')}` }) .parse() ``` You can simply run: `ncc build index.js`. ### Webpack Given a CommonJS file, **index.js**: ```js const yargs = require('yargs/yargs') const chalk = require('chalk') require('yargs/yargs')(process.argv.slice(2)) .option('awesome-opt', { describe: `my awesome ${chalk.green('option')}` }) .parse() ``` You can create a CommonJS bundle with the following `webpack.config.js`: ```js module.exports = { mode: "development", entry: { index: "./index.js", }, output: { filename: './index.js' }, resolve: { extensions: ['.js', '.cjs', '.json'] }, target: 'node', devtool: "source-map-inline", externals: { 'cliui': 'commonjs2 cliui', 'y18n': 'commonjs2 y18n', 'yargs-parser': 'commonjs2 yargs-parser', }, }; ```