Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul project, update to current standards #8

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
},
"modules": false
}
]
]
}
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
mocha: true
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'linebreak-style': ['error', 'unix'],
},
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/.history
node_modules
dist
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: node_js
node_js:
- "iojs"
- "iojs-v2"
- "iojs-v1"
- "0.12"
- "0.10"
- "6"
- "8"
- "10"
sudo: false
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha All",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--timeout", "999999", "--colors", "--compilers", "js:@babel/register", "'${workspaceFolder}/test/**/*.spec.js'"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
}
]
}
20 changes: 0 additions & 20 deletions Gruntfile.js

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2014-2019 Georg Tavonius

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,47 @@
[![Build Status][build-image]][build-url] [![dependencies][deps-image]][deps-url] [![dev-dependencies][dev-deps-image]][dev-deps-url]

# StackTrace-Parser

This parser parses a stack trace from any browser or Node.js and returns an array of hashes representing a line.

## Usage

``` JavaScript
import * as stackTraceParser from 'stacktrace-parser';

try {
throw new Error('My error');
} catch(ex) {
var lines = StackTraceParser.parse(ex.stack);
const stack = stackTraceParser.parse(ex.stack);
}
```

Every line contains four properties: `lineNumber`, `methodName`, `file` and `column` (if applicable).
Every line contains four properties: `lineNumber`, `methodName`, `arguments`, `file` and `column` (if applicable).

## TODOs

- allow to run in browser (v0.2)
- parse stack traces from other sources (Ruby, etc) (v0.3)

## Contribution

If you want to contrib, then do you thing, write tests, run `grunt test` ensure that everything is green , commit and make the pull request. Or just write an issue, or let's talk.
If you want to contrib, then do you thing, write tests, run `npm run test` ensure that everything is green,
commit and make the pull request. Or just write an issue, or let's talk.

## Contributors
BendingBender marked this conversation as resolved.
Show resolved Hide resolved

- [Georg Tavonius](https://github.com/calamari)
- [James Ide](https://github.com/ide)
- [Alexander Kotliarskyi](https://github.com/frantic)
- [Dimitri Benin](https://github.com/BendingBender)

## LICENSE

The MIT License (MIT)

Copyright (c) 2014-2015 Georg Tavonius

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
[The MIT License (MIT)](https://github.com/errwischt/stacktrace-parser/blob/master/LICENSE)

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
[build-image]: https://img.shields.io/travis/errwischt/stacktrace-parser/master.svg?style=flat-square
[build-url]: https://travis-ci.org/errwischt/stacktrace-parser
[deps-image]: https://img.shields.io/david/errwischt/stacktrace-parser.svg?style=flat-square
[deps-url]: https://david-dm.org/errwischt/stacktrace-parser
[dev-deps-image]: https://img.shields.io/david/dev/errwischt/stacktrace-parser.svg?style=flat-square
[dev-deps-url]: https://david-dm.org/errwischt/stacktrace-parser?type=dev
1 change: 0 additions & 1 deletion index.js

This file was deleted.

53 changes: 0 additions & 53 deletions lib/stacktrace-parser.js

This file was deleted.

4 changes: 4 additions & 0 deletions mocha-babel-hook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// different babel config for mocha, need to transpile modules
require('@babel/register')({
presets: ['@babel/preset-env'],
});
Loading