Skip to content

Commit

Permalink
chore: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Sep 22, 2023
1 parent ba53d03 commit bc85e25
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion examples/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ const {
* Post local files to the Turbo service.
*/
console.log('Posting raw file to Turbo service...');
const filePath = path.join(__dirname, '../files/0_kb.txt');
const filePath = path.join(__dirname, '../files/1KB_file');
const fileSize = fs.statSync(filePath).size;
const uploadResult = await turboAuthClient.uploadFile({
fileStreamFactory: () => fs.createReadStream(filePath),
fileSizeFactory: () => fileSize,
signal: AbortSignal.timeout(10_000), // cancel the upload after 10 seconds
});
console.log(JSON.stringify(uploadResult, null, 2));
Expand Down
2 changes: 1 addition & 1 deletion examples/cjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "commonjs",
"dependencies": {
"@ardrive/turbo-sdk": "^1.0.0-alpha.20"
"@ardrive/turbo-sdk": "^1.0.0-beta.1"
}
}
8 changes: 4 additions & 4 deletions examples/cjs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@ardrive/turbo-sdk@^1.0.0-alpha.18":
version "1.0.0-alpha.18"
resolved "https://registry.yarnpkg.com/@ardrive/turbo-sdk/-/turbo-sdk-1.0.0-alpha.18.tgz#c68791c75d27d0cba7932e2c6a151c7731ae80d6"
integrity sha512-9uhtoVWugjNabNkA96A7CFC+7vkudVhrcB2EQ8NPuqIJg5saL3eHf5G5vamn2M7u42qhDsLhRxqMBGeCCrjmVQ==
"@ardrive/turbo-sdk@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@ardrive/turbo-sdk/-/turbo-sdk-1.0.0-beta.1.tgz#dc7239977d9e904b96b93382dd49abac3ea7c414"
integrity sha512-3vOGst7zPo4ICkD+lfkfFRY/GP7NFYtaTEe1y9h+u8YMlZ0l3Akq/G+g303hY3M6mE3qHYCGXGPUjJ+eNpOekg==
dependencies:
arbundles "^0.9.9"
arweave "^1.14.4"
Expand Down
3 changes: 2 additions & 1 deletion examples/mjs/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ import fs from 'fs';
*/
console.log('Posting raw file to Turbo service...');
const filePath = new URL('../files/1KB_file', import.meta.url).pathname;
const fileSize = fs.statSync(filePath).size;
const uploadResult = await turboAuthClient.uploadFile({
fileStreamFactory: () => fs.createReadStream(filePath),
fileSizeFactory: () => fs.statSync(filePath).size,
fileSizeFactory: () => fileSize,
signal: AbortSignal.timeout(10_000), // cancel the upload after 10 seconds
});
console.log(JSON.stringify(uploadResult, null, 2));
Expand Down
2 changes: 1 addition & 1 deletion examples/mjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"dependencies": {
"@ardrive/turbo-sdk": "^1.0.0-alpha.20"
"@ardrive/turbo-sdk": "^1.0.0-beta.1"
}
}
8 changes: 4 additions & 4 deletions examples/mjs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@ardrive/turbo-sdk@^1.0.0-alpha.18":
version "1.0.0-alpha.18"
resolved "https://registry.yarnpkg.com/@ardrive/turbo-sdk/-/turbo-sdk-1.0.0-alpha.18.tgz#c68791c75d27d0cba7932e2c6a151c7731ae80d6"
integrity sha512-9uhtoVWugjNabNkA96A7CFC+7vkudVhrcB2EQ8NPuqIJg5saL3eHf5G5vamn2M7u42qhDsLhRxqMBGeCCrjmVQ==
"@ardrive/turbo-sdk@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@ardrive/turbo-sdk/-/turbo-sdk-1.0.0-beta.1.tgz#dc7239977d9e904b96b93382dd49abac3ea7c414"
integrity sha512-3vOGst7zPo4ICkD+lfkfFRY/GP7NFYtaTEe1y9h+u8YMlZ0l3Akq/G+g303hY3M6mE3qHYCGXGPUjJ+eNpOekg==
dependencies:
arbundles "^0.9.9"
arweave "^1.14.4"
Expand Down

0 comments on commit bc85e25

Please sign in to comment.