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 1 commit
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
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
BendingBender marked this conversation as resolved.
Show resolved Hide resolved
"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.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ This parser parses a stack trace from any browser or Node.js and returns an arra
## 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

Expand Down
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