Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
A node.js library that retrieves, parses and provides all schemas from schema.org
A node.js library that retrieves, parses and provides all schemas from schema.org
curl http://npmjs.org/install.sh | sh
[sudo] npm install schema-org
Although there is some debate from the W3C et al right now, when I came across schema.org I thought: "wow, what a gold mine of potential data formats to use in my applications." Then I looked at the site and thought: "Y U NO GIVE ME JSON FORMAT!?!?!" So I wrote this. It uses some other awesome node.js libraries:
Right now, node-schema-org
is implemented as a bin script which can be run after you install this module:
$ read-schema-org
Here is a sample of the output (all of the pre-parsed schemas are available here):
warn: Removing all schemas in /path/to/node-schema-org/schemas
info: Spawning: node /path/to/node-schema-org/list-schemas.js
info: Contacting: http://schema.org/docs/full.html
info: Parsing: http://schema.org/docs/full.html
info: Reading: http://schema.org/docs/full.html
info: Saving results to: /path/to/node-schema-org/schemas/schema-list.json
info: Done creating /path/to/node-schema-org/schemas/schema-list.json from http://schema.org/docs/full.html
info: node /path/to/node-schema-org/list-schemas.js has exited.
info: Spawning: node /path/to/node-schema-org/read-schema.js --type DataType
info: Spawning: node /path/to/node-schema-org/read-schema.js --type Boolean
info: Spawning: node /path/to/node-schema-org/read-schema.js --type Date
(....)
info: Parsing Type: Place
info: Parsing Type: Organization
info: Parsing Type: LocalBusiness
info: Writing schema: /path/to/node-schema-org/schemas/localbusiness.json
info: Done parsing schema: /path/to/node-schema-org/schemas/localbusiness.json
info: node /path/to/node-schema-org/read-schema.js --type LocalBusiness has exited.
info:
info: Done parsing all schemas from schema.org
info: They are located in: /path/to/node-schema-org/schemas
info:
{
"type": "Place",
"bases": {
"Thing": [
{
"name": "description",
"description": "A short description of the item.",
"type": "Text"
},
{
"name": "image",
"description": "URL of an image of the item.",
"type": "URL"
},
{
"name": "name",
"description": "The name of the item.",
"type": "Text"
},
{
"name": "url",
"description": "URL of the item.",
"type": "Text"
}
]
},
"properties": [
{
"name": "address",
"description": "Physical address of the item.",
"type": "PostalAddress"
},
{
"name": "aggregateRating",
"description": "The overall rating, based on a collection of reviews or ratings, of the item.",
"type": "AggregateRating"
},
{
"name": "containedIn",
"description": "The basic containment relation between places.",
"type": "Place"
},
{
"name": "events",
"description": "The events held at this place or organization.",
"type": "Event"
},
{
"name": "faxNumber",
"description": "The fax number.",
"type": "Text"
},
{
"name": "geo",
"description": "The geo coordinates of the place.",
"type": "GeoCoordinates"
},
{
"name": "interactionCount",
"description": "A count of a specific user interactions with this item—for example, 20 UserLikes, 5 UserComments, or 300 UserDownloads. The user interaction type should be one of the sub types of UserInteraction.",
"type": "Text"
},
{
"name": "maps",
"description": "A URL to a map of the place.",
"type": "Text"
},
{
"name": "photos",
"description": "Photographs of this place.",
"type": [
"Photograph",
"ImageObject"
]
},
{
"name": "reviews",
"description": "Review of the item.",
"type": "Review"
},
{
"name": "telephone",
"description": "The telephone number.",
"type": "Text"
}
]
}
FAQs
A node.js library that retrieves, parses and provides all schemas from schema.org
The npm package schema-org receives a total of 44 weekly downloads. As such, schema-org popularity was classified as not popular.
We found that schema-org 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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.