Closed benjamn closed 10 years ago
Using grasp as a library was not fully developed for version 0.1.0. In an upcoming version, this will be further developed so you don't have to mock fs
or process.stdin
for input.
Thank you for your use cases, they are useful. Please list any other ones you have as well. It looks like some other people are also looking for this type of thing: http://stackoverflow.com/questions/19878078/string-variable-to-stdin-interface
Grasp 0.2.0 was released today which adds some additional feature when using grasp as a library: http://graspjs.com/docs/lib/ - take a look at the new input
option, and the grasp.search
and grasp.replace
helper functions.
How much trouble would it be to support an interface like the following?
Or, even better:
This kind of interface would allow multiple transformations to be chained together easily, and would also leave the complexity of reprinting to an external library like https://github.com/Constellation/escodegen or https://github.com/benjamn/recast.
If grasp already supports use cases like this, please feel free to point me there (and close this issue).