Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,4 @@
# get-caller-file
[![Build Status](https://travis-ci.org/ember-cli/ember-cli.svg?branch=master)](https://travis-ci.org/ember-cli/ember-cli)
[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)

View File

@@ -0,0 +1,20 @@
'use strict';
// Call this function in a another function to find out the file from
// which that function was called from. (Inspects the v8 stack trace)
//
// Inspired by http://stackoverflow.com/questions/13227489
module.exports = function getCallerFile(_position) {
var oldPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function(err, stack) { return stack; };
var stack = new Error().stack;
Error.prepareStackTrace = oldPrepareStackTrace;
var position = _position ? _position : 2;
// stack[0] holds this file
// stack[1] holds where this function was called
// stack[2] holds the file we're interested in
return stack[position] ? stack[position].getFileName() : undefined;
};

View File

@@ -0,0 +1,63 @@
{
"_args": [
[
"get-caller-file@1.0.2",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "get-caller-file@1.0.2",
"_id": "get-caller-file@1.0.2",
"_inBundle": false,
"_integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
"_location": "/react-scripts/get-caller-file",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "get-caller-file@1.0.2",
"name": "get-caller-file",
"escapedName": "get-caller-file",
"rawSpec": "1.0.2",
"saveSpec": null,
"fetchSpec": "1.0.2"
},
"_requiredBy": [
"/react-scripts/webpack-dev-server/yargs",
"/react-scripts/webpack/yargs",
"/react-scripts/yargs"
],
"_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
"_spec": "1.0.2",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Stefan Penner"
},
"bugs": {
"url": "https://github.com/stefanpenner/get-caller-file/issues"
},
"description": "[![Build Status](https://travis-ci.org/ember-cli/ember-cli.svg?branch=master)](https://travis-ci.org/ember-cli/ember-cli) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)",
"devDependencies": {
"chai": "^3.4.1",
"ensure-posix-path": "^1.0.1",
"mocha": "^2.3.4"
},
"directories": {
"test": "tests"
},
"files": [
"index.js"
],
"homepage": "https://github.com/stefanpenner/get-caller-file#readme",
"license": "ISC",
"main": "index.js",
"name": "get-caller-file",
"repository": {
"type": "git",
"url": "git+https://github.com/stefanpenner/get-caller-file.git"
},
"scripts": {
"test": "mocha test",
"test:debug": "mocha test"
},
"version": "1.0.2"
}