-
Notifications
You must be signed in to change notification settings - Fork 99
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
NodeJS support - npm package - tests #4
base: master
Are you sure you want to change the base?
Conversation
Hi it-ony. Thank you for your participation. https://github.com/vkiryukhin/pretty-data Does your changes have any advantage over existing pretty-data version? --Vadim |
Hi, I saw the pretty-data version, after I changed the vkBeautify repository. I think having one library that work for nodejs as well as for the browser should be generally the goal. This is in my opinion the biggest advantage over the pretty-data version. This is possible from scratch because your library has no dependencies. This can be archived using the following snipped.
I think another advantages are the way the tests are written. No just printing the result, but also assert against the expected result. Modifying the tests to this approach, makes it possible to run them on a continues integration server. It's up to you, but I promise the open source community will thank you for having one, well tested library. -- Tony |
return text.replace(/\s{1,}/g, " ").replace(/\s{1,}\(/, "(").replace(/\s{1,}\)/, ")"); | ||
}; | ||
|
||
exports.VkBeautify = VkBeautify; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for nodejs and browser at the same time.
+1, i'm looking for a |
+1 for merging this pull request. |
👍 |
Hi,
I added nodejs support for your library and prepared it for publishing to npm. Just go into the directory and use
npm publish
. See https://npmjs.org/doc/publish.html.I also added two simple tests with mocha. Use
mocha -R spec
inside the project directory to run the tests. The project is also prepared to to run the tests on http://travis-ci.org.