| Server IP : 216.238.66.20 / Your IP : 216.73.216.51 Web Server : nginx/1.30.4 System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/energia-cce.gamliel.mx/htdocs/energia-cce/node_modules/direction/ |
Upload File : |
#!/usr/bin/env node
'use strict'
var pack = require('./package.json')
var direction = require('.')
var argv = process.argv.slice(2)
if (argv.indexOf('--help') !== -1 || argv.indexOf('-h') !== -1) {
console.log(help())
} else if (argv.indexOf('--version') !== -1 || argv.indexOf('-v') !== -1) {
console.log(pack.version)
} else if (argv.length === 0) {
process.stdin.resume()
process.stdin.setEncoding('utf8')
process.stdin.on('data', function(data) {
console.log(direction(data))
})
} else {
console.log(direction(argv.join(' ')))
}
function help() {
return [
'',
' Usage: ' + pack.name + ' [options] <words...>',
'',
' ' + pack.description,
'',
' Options:',
'',
' -h, --help output usage information',
' -v, --version output version number',
'',
' Usage:',
'',
' # output directionality',
' $ ' + pack.name + ' @',
' # ' + direction('@'),
'',
' # output directionality from stdin',
" $ echo 'الانجليزية' | " + pack.name,
' # ' + direction('الانجليزية'),
''
].join('\n')
}