-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Please, provide a more descriptive example in the Usage section. #5
Comments
Not sure I get this. You pass a file entry point ('path_to_file.js') to 'detective' ... I can't seem to understand this sentense:
What is 'Source content'? And I thought that an AST would be what I would get back from konan, not pass into it ... !? So I ask again: Can it be used like this?:
|
I can only generate this error: |
Source content means the JS code/AST you want to traverse. |
But then I need ANOTHER module to get the AST from the code!? I would expect konan to return THAT based upon a file path I pass to it ... !? |
It's VERY confusing! |
Could you please provide an example where you simply pass in a file path as a string ... IF that's how I can use it! |
This code:
simply doesn't make any sense. |
'detective' works like this:
And I can't see how that matches how 'konan' works ... ? |
like I said, code or AST: const code = `
console.log('js code')
`
konan(code)
//-------------- or hmm read the content from a script
const fs = require('fs')
const content = fs.readFileSync('./your/script', 'utf8')
konan(content)
//-------------- or if you already have an AST tree
konan(ast) Does this make sense to you? |
Well, it only tell me that the module does NOT work like 'detective`. And that's why I get errors when trying to do this:
|
It keep throwing this at me:
Please, provide complete example of what |
There're edge cases when it says The |
I've done this as well, but still the same:
|
https://github.com/egoist/konan/blob/master/test/index.test.js it works for me |
@sabsaxo I think you should make an example by codesandbox |
It's not clear how to actually use this. The example strings are out of context, so it's hard to 'guess' what to actually pass to the module.
Can it be used like this?:
The text was updated successfully, but these errors were encountered: