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,8 @@
'use strict';
module.exports = function () {
var _ = Error.prepareStackTrace;
Error.prepareStackTrace = function (_, stack) { return stack };
var stack = new Error().stack.slice(1);
Error.prepareStackTrace = _;
return stack;
};

View File

@@ -0,0 +1,71 @@
{
"_args": [
[
"callsites@0.2.0",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "callsites@0.2.0",
"_id": "callsites@0.2.0",
"_inBundle": false,
"_integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
"_location": "/react-scripts/callsites",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "callsites@0.2.0",
"name": "callsites",
"escapedName": "callsites",
"rawSpec": "0.2.0",
"saveSpec": null,
"fetchSpec": "0.2.0"
},
"_requiredBy": [
"/react-scripts/caller-path"
],
"_resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
"_spec": "0.2.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/callsites/issues"
},
"description": "Get callsites from the V8 stack trace API",
"devDependencies": {
"mocha": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/callsites#readme",
"keywords": [
"callsites",
"callsite",
"v8",
"stacktrace",
"stack",
"trace",
"function",
"file",
"line",
"debug"
],
"license": "MIT",
"name": "callsites",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/callsites.git"
},
"scripts": {
"test": "mocha"
},
"version": "0.2.0"
}

View File

@@ -0,0 +1,47 @@
# callsites [![Build Status](https://travis-ci.org/sindresorhus/callsites.svg?branch=master)](https://travis-ci.org/sindresorhus/callsites)
> Get callsites from the [V8 stack trace API](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi)
## Install
```sh
$ npm install --save callsites
```
## Usage
```js
var callsites = require('callsites');
function unicorn() {
console.log(callsites()[0].getFileName());
//=> /Users/sindresorhus/dev/callsites/test.js
}
unicorn();
```
## API
Returns an array of callsite objects with the following methods:
- `getThis`: returns the value of this
- `getTypeName`: returns the type of this as a string. This is the name of the function stored in the constructor field of this, if available, otherwise the object's [[Class]] internal property.
- `getFunction`: returns the current function
- `getFunctionName`: returns the name of the current function, typically its name property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
- `getMethodName`: returns the name of the property of this or one of its prototypes that holds the current function
- `getFileName`: if this function was defined in a script returns the name of the script
- `getLineNumber`: if this function was defined in a script returns the current line number
- `getColumnNumber`: if this function was defined in a script returns the current column number
- `getEvalOrigin`: if this function was created using a call to eval returns a CallSite object representing the location where eval was called
- `isToplevel`: is this a toplevel invocation, that is, is this the global object?
- `isEval`: does this call take place in code defined by a call to eval?
- `isNative`: is this call in native V8 code?
- `isConstructor`: is this a constructor call?
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)