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

Introduce additional helpers for getting tokens/total size #166

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

maximmenshikov
Copy link

jsmn requires a lot of manual work in each project to actually start working with JSON. I've added API to:

  1. get total number of tokens consumed by token and its children
  2. get token with a given key (in objects)
  3. get token by index (in array)

This API is pretty much enough for use in real projects, in my opinion. Covered by unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant