Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@digix/dijix
Advanced tools
This project aims to make IPFS objects easier to view by processing files and creating a standardised JSON schema that includes metadata about the file and allows clients to more efficiently render them.
The system is designed for use in the Digix Proof of Asset system (and other future projects) that leverages IPFS for immutable storage. Dijix allows for painless reading and uploading of this data in-browser.
Dijix consists of:
semantic-ui-react
component libraries for rendering dijix types in-browser (TODO)The entire dijix suite (except for react components) is supported in the browser, node and via a command line interface.
Dijix objects are JSON objects (uploaded to IPFS) with the following properties:
Dijix objects come with standard headers and a type-specific data
schema. Here's an example:
{
"type": "image",
"created": 1505208269402,
"schema": "0.0.1",
"data": {
"height": 250,
"width": 940,
"src": "QmPQkRRAryL8MHu8ERabQNVgHcsixnZDjzm3nuTW7Xq81n",
"size": 100789,
"mime": "image/jpeg",
"thumbnails": {
"64": "Qme4PHgc7Ecfddg268WYEBagsnc9skNntM9BKbqjzAkajU",
"256": "QmW4FkWdzRjAnJSnwHWSMxu4mL6rqo5AyfB4b4yUQ1PQ9i",
"512": "QmQSjeNksgWWK7Bvk9YtMomFZmVMNkGcwvEQNYqFmSdvFE"
},
"fileName": "banner.jpg"
},
"ipfsHash": "QmUdRPGRxtz3ww3mHZB6dd4qmbYvrFRbrUVKW5XApiWGKF"
}
A middleware system will provide optional functionality when importing and/or reading dijix objects:
import Dijix from 'dijix';
import DijixImage from 'dijix-image';
import DijixPDF from 'dijix-pdf';
const dijix = new Dijix({
ipfsEndpoint: 'https://ipfs.infura.io:5001', // optional
httpEndpoint: 'https://ipfs.infura.io/ipfs', // optional
cache: true, // optional in-memory dijix object cache, defaults to true
concurrency: 10, // optional
requestTimeout: 1000, //optional
types: [
new DijixImage(),
new DijixPDF(),
],
});
await dijix.create('image', { src: '/some/image.jpg', ...config }); // outputs dijix object
await dijix.create('pdf', { src: '/some/pdf.pdf', ...config }); // outputs dijix object
// This returns the document if found within `requestTimeout` milliseconds
// otherwise logs the error
await dijix.failSafeFetch(ipfsHash);
For node and CLI, you'll need npm, node 8+ and cairo / libpng. See dijix-image for instructions.
$ npm install -g dijix dijix-image dijix-pdf
dijix create pdf ~/Desktop/Sample.pdf
processing page 0 of 1
{
"type": "pdf",
"created": 1505207437136,
"schema": "0.0.1",
"data": {
"fileSize": 37545,
"metaData": {},
"pageCount": 1,
"src": "QmSkA3k4ksCvJPP2fojXsW15GHa1AJwytLonJikKFvFA4R",
"mime": "application/pdf",
"fileName": "Sample.pdf",
"name": "test",
"pages": [
"QmeFUkpXBMF29XvxpfQm58EprrAxDVMpMBGe5chTkjVS4r"
]
},
"ipfsHash": "QmUfzvU4Q1rsR8U9Ti3Wib2enUX2zuy7FAxY2RoQEQ79NT"
}
To run node and browser tests:
npm run test
BSD-3-Clause
FAQs
Digix's IPFS & JSON Immutable & eXtendable File Format Edit
We found that @digix/dijix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.