Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aragon/apm

Package Overview
Dependencies
Maintainers
7
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aragon/apm - npm Package Compare versions

Comparing version 1.0.0-beta.8 to 1.0.0-beta.9

2

package.json
{
"name": "@aragon/apm",
"version": "1.0.0-beta.8",
"version": "1.0.0-beta.9",
"description": "JavaScript library for the Aragon Package Manager",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -30,3 +30,3 @@ const ipfs = require('./providers/ipfs')

const readFileFromApplication = (contentURI, path) => {
const getProviderFromURI = (contentURI, path) => {
const [contentProvider, contentLocation] = contentURI.split(/:(.+)/)

@@ -42,5 +42,15 @@

return providers[contentProvider].getFile(contentLocation, path)
return { provider: providers[contentProvider], location: contentLocation }
}
const readFileFromApplication = (contentURI, path) => {
const { provider, location } = getProviderFromURI(contentURI, path)
return provider.getFile(location, path)
}
const readFileStreamFromApplication = (contentURI, path) => {
const { provider, location } = getProviderFromURI(contentURI, path)
return provider.getFileStream(location, path)
}
const getApplicationInfo = (contentURI) => {

@@ -82,2 +92,3 @@ return Promise.all([

getFile: readFileFromApplication,
getFileStream: readFileStreamFromApplication,

@@ -84,0 +95,0 @@ /**

@@ -23,3 +23,15 @@ const got = require('got')

},
/**
* Gets the file stream at `path` from the content URI `hash`.
*
* @param {string} hash The content URI hash
* @param {string} path The path to the file
* @return {Stream} A stream representing the content of the file
*/
getFileStream (host, path) {
return got.stream(`${host}/${path}`)
},
/**
* Uploads all files from `path` and returns the content URI for those files.

@@ -26,0 +38,0 @@ *

@@ -20,3 +20,15 @@ const ipfsAPI = require('ipfs-api')

},
/**
* Gets the file stream at `path` from the content URI `hash`.
*
* @param {string} hash The content URI hash
* @param {string} path The path to the file
* @return {Stream} A stream representing the content of the file
*/
getFileStream (hash, path) {
return ipfs.files.catReadableStream(`${hash}/${path}`)
},
/**
* Uploads all files from `path` and returns the content URI for those files.

@@ -23,0 +35,0 @@ *

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc