
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
internet-object
Advanced tools
Welcome to the official JavaScript repository for Internet Object, a lean, robust, and schema-first data interchange format designed for the Internet. As a well-structured alternative to JSON, Internet Object offers a user-friendly API for JavaScript and TypeScript, making it effortless to work with Internet Object documents.
For specification and more information, visit InternetObject.org Docs.
The example below illustrates the usage of Internet Object for parsing a basic internet object document. Please be aware that the API is still in development and has not been officially released. This is purely for demonstration purposes.
import { ioDocument } from 'internet-object';
const doc = ioDocument`
name, age, gender, address: {street, city, state, zip}
---
~ John, 25, M, {123 Main St, Anytown, CA, 12345}
~ Jane, 30, F, {456 Main St, Anytown, CA, 12345}`;
console.log(doc);
import { ioDefinitions, ioDocument } from 'internet-object';
const defs = ioDefinitions`
~ @red: 0xff0000
~ @blue: 0x0000ff
~ @green: 0x00ff00
~ $schema: {
name, age, gender, color, address: {street, city, state, zip}
}`;
// Parse document with external definitions
const doc = ioDocument.with(defs)`
~ John, 25, M, @green, {123 Main St, Anytown, CA, 12345}
~ Jane, 30, F, @blue, {456 Main St, Anytown, CA, 12345}`;
import { Collection, Document, InternetObject } from 'internet-object';
const collection = new Collection();
collection.push(
new InternetObject("John Doe", 25, "M", "@green", new io.Object("123 Main St", "Anytown", "CA", "12345")),
new InternetObject("Jane Doe", 30, "F", "@blue", new io.Object("456 Main St", "Anytown", "CA", "12345")),
)
const doc = new Document();
doc.data.pushToFirst(collection);
In Internet Object, objects serve as the fundamental building blocks. There are numerous ways to create these objects. Below are a few examples.
// Using the Object constructor
const o1 = new InternetObject("John Doe", 25, "M", "@green", new io.Object("123 Main St", "Anytown", "CA", "12345"));
// Using the Object constructor with an array
const arr = [ "John Doe", 25, "M", "@green", new io.Object("123 Main St", "Anytown", "CA", "12345") ]
const o2 = new io.Object(...arr);
// Using string interpolation
const o3 = io.object`John Doe, 25, M, @green, {123 Main St, Anytown, CA, 12345}`;
// Using the Object.import method
const o4 = InternetObject.import({
name: "John Doe",
age: 25,
gender: "M",
color: "@green",
address: {
street: "123 Main St",
city: "Anytown",
state: "CA",
zip: "12345"
}
})
Often, before transmitting a document to a remote location, it's crucial to validate the document against a predefined schema or definition. If the validation process detects an invalid value, it will throw a ValidationError
.
try {
doc.validate(defs);
console.log("Document is valid");
} catch (e) {
console.log(e);
}
During the tokenization and parsing process, if an error is encountered, an exception is promptly thrown. This exception pinpoints the exact location of the error. Furthermore, the exception may also detail the specific token that instigated the error.
const tokens = io.parser.tokenize(code)
const ast = io.parser.parse(tokens)
// Convert AST to Document
const doc = io.parser.compile(ast)
// Convert AST to Definitions
const defs = io.parser.compileDefs(ast)
🚧 Pull requests are currently not accepted. Development is ongoing, and the API is still under finalization. Once the API is stable, we will welcome contributions. Please note that the following instructions are for reference only.
yarn install
./src
./tests/
yarn test
For a comprehensive understanding of Internet Object, refer to the official specification available at docs.InternetObject.org.
ISC License:
© 2018-2024 ManiarTech®️. All rights reserved.
FAQs
Internet Object Typescript/JavaScript library
The npm package internet-object receives a total of 4 weekly downloads. As such, internet-object popularity was classified as not popular.
We found that internet-object demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.