Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: example require #1136

Merged
merged 3 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/compose-object-test-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const os = require('os')
const splitFile = require('split-file')
const fs = require('fs')

var Minio = require('../dist/main/minio')
var Helpers = require('../dist/main/helpers')
var Minio = require('minio')
var Helpers = require('minio/dist/main/helpers')
Comment on lines +23 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to start modifying the variable instance with const rather than var?

Copy link
Contributor Author

@trim21 trim21 May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters in example. But it's better we perfer const in src code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would be a way to say that the library has been modernized. But it's okay if we're still using var on examples.

Copy link
Contributor Author

@trim21 trim21 May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer-const is previous disabled in eslint, I don't know how maintainers think. And I don't care much about code style in examples...


var s3Client = new Minio.Client({
endPoint: 's3.amazonaws.com',
Expand Down
4 changes: 2 additions & 2 deletions examples/compose-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname
// are dummy values, please replace them with original values.

var Minio = require('../dist/main/minio')
var Helpers = require('../dist/main/helpers')
var Minio = require('minio')
var Helpers = require('minio/dist/main/helpers')

var s3Client = new Minio.Client({
endPoint: 's3.amazonaws.com',
Expand Down
2 changes: 1 addition & 1 deletion examples/minio/listen-bucket-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Note that `listenBucketNotification` is only available for MinIO, and not
// Amazon.

const Minio = require('../')
const Minio = require('minio')

var s3Client = new Minio.Client({
endPoint: '...',
Expand Down
2 changes: 1 addition & 1 deletion examples/select-object-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname
// and my-objectname are dummy values, please replace them with original values.

var Minio = require('../dist/main/minio')
var Minio = require('minio')

var s3Client = new Minio.Client({
endPoint: 's3.amazonaws.com',
Expand Down