Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Data.js is a data representation framework for Javascript. It's being developed in the context of Substance, an open publishing platform.
For documentation, usage, and examples, see the offical documentation: http://substance.io/michael/data-js
Data.Graph
(A data abstraction for all kinds of linked data)Data.Collection
(A simplified interface for tabular data)Define a schema
var schema = {
"/type/person": {
"type": "/type/type",
"name": "Person",
"properties": {
"name": {"name": "Name", "type": "string", "required": true},
"origin": {"name": "Origin", "type": "/type/location" }
}
},
"/type/location": {
"type": "/type/type",
"name": "Location",
"properties": {
"name": { "name": "Name", "unique": true, "type": "string", "required": true },
"citizens": {"name": "Citizens", "unique": false, "type": "/type/person"}
}
}
};
Create a new Data.Graph.
var graph = new Data.Graph(schema);
Add some objects.
graph.set({
_id: "/person/bart",
type: "/type/person",
name: "Bart Simpson"
});
graph.set({
_id: "/location/springfield",
name: "Springfield",
type: "/type/location",
citizens: ["/person/bart"]
});
Set properties (including relationships to other objects)
graph.get('/person/bart')
.set({origin: '/location/springfield'});
Access your data.
var citizens = graph.get('/location/springfield').get('citizens');
_.each(citizens, function(person) {
console.log(person.get('name'));
});
FAQs
A Javascript data representation library.
The npm package data receives a total of 3,848 weekly downloads. As such, data popularity was classified as popular.
We found that data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.