Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.117.9.230
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/npm/node_modules/fstream-npm/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/npm/node_modules/fstream-npm/test/ignores.js
var fs = require('graceful-fs')
var join = require('path').join

var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var test = require('tap').test

var Packer = require('..')

var pkg = join(__dirname, 'test-package')

var elfJS = function () {/*
module.exports = function () {
  console.log("i'm a elf")
}
*/}.toString().split('\n').slice(1, -1).join()

var json = {
  'name': 'test-package',
  'version': '3.1.4',
  'main': 'elf.js'
}

test('setup', function (t) {
  setup()
  t.end()
})

var included = [
  'package.json',
  'elf.js',
  join('deps', 'foo', 'config', 'config.gypi')
]

test('follows npm package ignoring rules', function (t) {
  var subject = new Packer({ path: pkg, type: 'Directory', isDirectory: true })
  var filenames = []
  subject.on('entry', function (entry) {
    t.equal(entry.type, 'File', 'only files in this package')

    // include relative path in filename
    var filename = entry._path.slice(entry.root._path.length + 1)

    filenames.push(filename)
  })
  // need to do this so fstream doesn't explode when files are removed from
  // under it
  subject.on('end', function () {
    // ensure we get *exactly* the results we expect by comparing in both
    // directions
    filenames.forEach(function (filename) {
      t.ok(
        included.indexOf(filename) > -1,
        filename + ' is included'
      )
    })
    included.forEach(function (filename) {
      t.ok(
        filenames.indexOf(filename) > -1,
        filename + ' is not included'
      )
    })
    t.end()
  })
})

test('cleanup', function (t) {
  // rimraf.sync chokes here for some reason
  rimraf(pkg, function () { t.end() })
})

function setup () {
  rimraf.sync(pkg)
  mkdirp.sync(pkg)
  fs.writeFileSync(
    join(pkg, 'package.json'),
    JSON.stringify(json, null, 2)
  )

  fs.writeFileSync(
    join(pkg, 'elf.js'),
    elfJS
  )

  fs.writeFileSync(
    join(pkg, '.npmrc'),
    'packaged=false'
  )

  fs.writeFileSync(
    join(pkg, '.npmignore'),
    '.npmignore\ndummy\npackage.json'
  )

  fs.writeFileSync(
    join(pkg, 'dummy'),
    'foo'
  )

  var buildDir = join(pkg, 'build')
  mkdirp.sync(buildDir)
  fs.writeFileSync(
    join(buildDir, 'config.gypi'),
    "i_wont_be_included_by_fstream='with any luck'"
  )

  var depscfg = join(pkg, 'deps', 'foo', 'config')
  mkdirp.sync(depscfg)
  fs.writeFileSync(
    join(depscfg, 'config.gypi'),
    "i_will_be_included_by_fstream='with any luck'"
  )

  fs.writeFileSync(
    join(buildDir, 'npm-debug.log'),
    '0 lol\n'
  )

  var gitDir = join(pkg, '.git')
  mkdirp.sync(gitDir)
  fs.writeFileSync(
    join(gitDir, 'gitstub'),
    "won't fool git, also won't be included by fstream"
  )

  var historyDir = join(pkg, 'node_modules/history')
  mkdirp.sync(historyDir)
  fs.writeFileSync(
    join(historyDir, 'README.md'),
    "please don't include me"
  )
}

Anon7 - 2022
AnonSec Team