Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
haystack-core
Advanced tools
A core haystack implementation written in TypeScript.
This library is designed to be used in conjunction with these other haystack libraries depending on your use case...
If you're after a high performance haystack library for running on constrained devices, please see libhaystack.
npm install haystack-core
Please click here for the API documentation.
The following core Haystack types are implemented...
Each haystack value has a kind that can be queried. A haystack value can be encoded to Zinc by calling toZinc()
.
To convert a Zinc back to a haystack value see ZincReader
.
Haystack core has full support for units. The actual unit database implementation is stored in haystack-units. This enables a developer to import the whole unit database or just the units they're interested in working in.
Haystack core has comprehensive support for Haystack v4 defs. Defs add an ontology to the pre-existing haystack taxonomy that is now formalized.
The TrioReader
and TrioWriter
classes are used to read and write Trio files.
Hayson is an alternative JSON encoding format for Haystack that's being promoted.
Hayson has full support in Haystack Core.
An abbreviated namespace of useful methods has been created to make it easier to work with in environments such as a web browser.
A full haystack filter compiler implementation is included.
To work with filters please see HFilter.
HFilterBuilder
For the full grammar, please see the class definition for the Parser.
The main class to work with is HFilter. This class contains a number of high level methods that hide the complexity of working with the underlying parser.
When a haystack filter string is parsed, it's converted into an AST (abstract syntax tree) hierarchy of Nodes.
The Node tree can be used in the following ways...
The visitor design pattern has been implemented to make it easy to generate code for different targets (i.e. a haystack filter string).
Any errors caught during parsing are thrown as LocalizedError objects. This error object contains a lexicon key and arguments used for localization as well as a possible index number. If the index number is defined, it will specify the index number of the character that caused the error in the original haystack filter.
FAQs
Project Haystack Core
The npm package haystack-core receives a total of 2,197 weekly downloads. As such, haystack-core popularity was classified as popular.
We found that haystack-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.