Comments (8)
Did you check the API docs linked in README? https://github.com/jDataView/jBinary/wiki
from jbinary.
I'll close this as this is documented under Strings in the docs.
from jbinary.
I read every single page of the docs in the wiki and I honestly still have no idea how your library works.
After hours of debugging and looking at the source I still cannot figure out how to read a string, or rather how to provide a length parameter to the read
function as shown above.
The read
function only accepts a type name and an offset, no mention of params for the provided type.
from jbinary.
I'm also using TypeScript by the way, so your type definitions might be incorrect ? Since there is aboslutely no way to specify params in the read
function for a given type
from jbinary.
I read every single page of the docs in the wiki and I honestly still have no idea how your library works.
https://github.com/jDataView/jBinary/wiki/Type-usage-syntax describes how to pass type params in general (['typeName', arg1, arg2, ..., argN]
).
https://github.com/jDataView/jBinary/wiki/Standard-types#strings documents string type arguments to be passed using syntax above.
https://github.com/jDataView/jBinary/wiki/Typesets even has a detailed example, showing usage of strings among others.
from jbinary.
I'm sorry but your docs honestly make no sense and don't match your type definitions, if you look at the first comment I made it shows the method signature in TypeScript for the read
method.
It only accepts 2 arguments, type
and offset
, type
can either be a string
or a [string, string, number?]
which does definitely not match anything in your docs. So I'm lost as to how I'm supposed to pass parameters into this function in a sane way.
from jbinary.
It just seems like the function signature is missing a params: any[]
argument
from jbinary.
I don't know where TS definitions you're seeing are coming from, and correspondingly can't comment on why they don't match the docs - the library itself doesn't have TS definitions.
But I've provided plenty of links above with examples, including specific example for strings:
jDataView/jBinary/wiki/Typesets even has a detailed example, showing usage of strings among others.
That page literally shows ['string0', 256]
as an example of passing length.
from jbinary.
Related Issues (20)
- im noob HOT 6
- Dispatch to typedef based on context? HOT 3
- ios write blob to file HOT 3
- Type Caching and Memory Use HOT 3
- Question: How to convert the "uint16" value to half-precision float (i.e. "float16")? HOT 1
- Dynamic Types? HOT 2
- jBinary::readAll does not mutate the internal pointer HOT 3
- writeAll() method documentation and functionality HOT 3
- corsproxy.com redirects to dubious web sites HOT 1
- SaveAsSync? HOT 2
- BROWSER vs NODE differences HOT 3
- Change Endianness (question) HOT 4
- "index out of range" with dynamic array size HOT 5
- Just don't work, maybe it caused by electron? :-{ HOT 1
- Local build is failing HOT 3
- Remove old polyfills
- Switch to ESM+Rollup
- reproducable out-of-memory errors using 'array'
- Strings ignores length on writing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbinary.