NPM should understand package.jsonc files (JSON with // and /* */ comment syntax).
-
-
Replying to @bterlson
I think the issue is that it’s difficult to programmatically modify such files.
3 replies 0 retweets 6 likes -
I've written a JSON parser that retains comments, and when stringified emits comments in the same places. Not sure why nobody has released anything similar.
1 reply 0 retweets 2 likes -
Tell me more about this! You store deserialized JSON objects in a map or something so you can retrieve trivia when they are re-serialized?
1 reply 0 retweets 0 likes -
JSON parser tracks the current properties being parsed, when it encounters comments it assigns them to a map with the current key path. It's just a single map of object paths to comments. Then have a type-safe interface to consume the JSON, which has a `stringify` method.
2 replies 0 retweets 2 likes
It looks like this: https://gist.github.com/kittens/b81a865d4f91651ce9127ea85c524e97 … You can also just use the parse() method and do your own manual refinements if you want.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 