diff --git a/examples/car-to-fixture.js b/examples/car-to-fixture.js index 0556679..82788ee 100755 --- a/examples/car-to-fixture.js +++ b/examples/car-to-fixture.js @@ -1,17 +1,19 @@ #!/usr/bin/env node +/* eslint-disable no-console */ + // Take a .car file and dump its contents to stdout as a single DAG-JSON format // block. The format is standardised for describing CAR fixtures at // https://ipld.io/specs/transport/car/fixture/ import fs from 'fs' -import { CarReader } from '@ipld/car/reader' import { CarIndexer } from '@ipld/car/indexer' +import { CarReader } from '@ipld/car/reader' import * as dagCbor from '@ipld/dag-cbor' -import * as dagPb from '@ipld/dag-pb' import * as dagJson from '@ipld/dag-json' -import * as raw from 'multiformats/codecs/raw' +import * as dagPb from '@ipld/dag-pb' import * as json from 'multiformats/codecs/json' +import * as raw from 'multiformats/codecs/raw' if (!process.argv[2]) { console.log('Usage: dump-car.js ') diff --git a/examples/dump-car.js b/examples/dump-car.js index 27e331f..98d2e2d 100755 --- a/examples/dump-car.js +++ b/examples/dump-car.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +/* eslint-disable no-console */ + // Take a .car file and dump its contents into one file per block, with the // filename being the CID of that block. // Also prints a DAG-JSON form of the block and its CID to stdout. @@ -8,10 +10,10 @@ import fs from 'fs' import { CarBlockIterator } from '@ipld/car/iterator' import * as dagCbor from '@ipld/dag-cbor' -import * as dagPb from '@ipld/dag-pb' import * as dagJson from '@ipld/dag-json' -import * as raw from 'multiformats/codecs/raw' +import * as dagPb from '@ipld/dag-pb' import * as json from 'multiformats/codecs/json' +import * as raw from 'multiformats/codecs/raw' if (!process.argv[2]) { console.log('Usage: dump-car.js [--inspect] ') diff --git a/examples/dump-index.js b/examples/dump-index.js index fcc0453..864fb08 100755 --- a/examples/dump-index.js +++ b/examples/dump-index.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +/* eslint-disable no-console */ + // Take a .car file and dump its index in DAG-JSON format, one line per block import fs from 'fs' diff --git a/examples/round-trip.js b/examples/round-trip.js index 4ab40ca..c96c011 100755 --- a/examples/round-trip.js +++ b/examples/round-trip.js @@ -1,13 +1,15 @@ #!/usr/bin/env node +/* eslint-disable no-console */ + // Create a simple .car file with a single block and that block's CID as the // single root. Then read the .car and fetch the block again. import fs from 'fs' import { Readable } from 'stream' import { CarReader, CarWriter } from '@ipld/car' -import * as raw from 'multiformats/codecs/raw' import { CID } from 'multiformats/cid' +import * as raw from 'multiformats/codecs/raw' import { sha256 } from 'multiformats/hashes/sha2' async function example () { diff --git a/examples/test-examples.js b/examples/test-examples.js index 3f2f5c0..c409d35 100644 --- a/examples/test-examples.js +++ b/examples/test-examples.js @@ -1,7 +1,9 @@ +/* eslint-disable no-console */ + import assert from 'assert' -import { promisify } from 'util' import { execFile } from 'child_process' import { promises as fsPromises } from 'fs' +import { promisify } from 'util' const { unlink, stat } = fsPromises diff --git a/examples/verify-car.js b/examples/verify-car.js index ce737bd..3a65050 100755 --- a/examples/verify-car.js +++ b/examples/verify-car.js @@ -1,21 +1,23 @@ #!/usr/bin/env node +/* eslint-disable no-console */ + // Example: verify a car file's block bytes match the reported CIDs and that // they have round-tripishness. // This example is overly verbose but illustrates some concepts involved in CAR // files. import fs from 'fs' -import { bytes, CID } from 'multiformats' import { CarBlockIterator } from '@ipld/car/iterator' import * as dagCbor from '@ipld/dag-cbor' -import * as dagPb from '@ipld/dag-pb' import * as dagJson from '@ipld/dag-json' -import * as raw from 'multiformats/codecs/raw' +import * as dagPb from '@ipld/dag-pb' +import { blake2b256 } from '@multiformats/blake2/blake2b' +import { bytes, CID } from 'multiformats' import * as json from 'multiformats/codecs/json' -import { sha256 } from 'multiformats/hashes/sha2' +import * as raw from 'multiformats/codecs/raw' import { from as hasher } from 'multiformats/hashes/hasher' -import { blake2b256 } from '@multiformats/blake2/blake2b' +import { sha256 } from 'multiformats/hashes/sha2' const { toHex } = bytes