ipfs-http-client
Version:
A client library for the IPFS HTTP API
18 lines • 403 B
JavaScript
import {
encodeQuery,
decodePin
} from './utils.js';
export function createLs(client) {
async function* ls({timeout, signal, headers, ...query}) {
const response = await client.post('pin/remote/ls', {
timeout,
signal,
headers,
searchParams: encodeQuery(query)
});
for await (const pin of response.ndjson()) {
yield decodePin(pin);
}
}
return ls;
}