frictionlessdata / datapackage-js

A JavaScript library for working with Data Package.
http://frictionlessdata.io/
MIT License
43 stars 15 forks source link

Relative paths in remote datapackages don't work #41

Closed roll closed 7 years ago

roll commented 7 years ago

Overview

const Datapackage = require('datapackage-test').Datapackage
const descriptor = 'https://raw.githubusercontent.com/frictionlessdata/datapackage-js/master/data/dp1/datapackage.json'

new Datapackage(descriptor).then(dp => {
    dp.resources[0].table.then(table => console.log(table.read()))
})
Error: ENOENT: no such file or directory, open 'data.csv'

Tasks

rufuspollock commented 7 years ago

@roll any update on a fix here (or confirmation this is a bug)? I'd like to use this feature in DPR if we can ...

roll commented 7 years ago

@rufuspollock It's confirmed - we're starting to work on it.

dumyan commented 7 years ago

@roll

this should be fixed in jsontableschema-js, because we're just wrapping the Table class here. Basically when doing table.read() you are using only jsontableschema-js code.

Therefore, the estimate is for jsontableschema-js.

roll commented 7 years ago

I suppose error could be in code where we pass path to jsontableschema.Table