S3 Url Exists is an abstraction package made to check if the key into the buckets really exist and it's public
$ npm i Btime/s3-url-exists#semver:^1 -Sconst S3UrlExists = require('s3-url-exists')
const options = {
region: 'sa-east-1',
bucket: 'bucket-name',
key: 'file-name'
}
S3UrlExists(options)
.then((result) => {
/*
* { status: true, url: 'https://s3-region.amazonaws.com/bucket-name/file-name' }
*/
})
.catch(err => {
/*
* Request Error
*/
})All pushes must come with a new tag. The tag usage must consider semantic versions.
[major version: incompatible changes].[minor version: compatible with major].[patch version: bug fixes]
Before pushing each version, type:
- For patch changes:
npm version patch - For minor changes:
npm version minor - For major changes:
npm version major
The version set must also be set in package.json file, at version field.
- Create
.envfile:
$ cp .env .env.dist- Run tests:
$ npm test