Skip to content

Commit

Permalink
feat: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nhoss2 committed Jul 5, 2024
1 parent 3e6d5db commit b837899
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
41 changes: 40 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
lilsync
-------

lilsync is a tool that takes images from an s3 compatible cloud storage, creates optimised/resized versions of those images and reuploads them.
lilsync is a tool that takes images from an s3 compatible cloud storage, creates optimised/resized versions of those images and reuploads them.

Get Started
===========

Install:
```
npm install -g lilsync
```

Then create a config file in your home directory called `.lilsyncrc.yaml`.

Config
======
lilsync requires a config file called .lilsyncrc.yaml either in the current directory or in your home directory.

An example home directory is as follows:
```
bucketName: milkyway
credentials:
accessKeyId: "abc"
secretKey: "def"
endpointUrl: "https://s3.somewhere.tld"
inputConfig:
outputPath: "out/"
inputPath: "images/"
outputImages:
- width: 1250
quality: 95
- width: 500
quality: 95
ext: png
```

- bucketName: string representing the bucket where images will be stored
- credentials: s3 compatible credentials. Instead of providing this section you can also have the following environment variables: `ACCESS_KEY_ID`, `SECRET_KEY` and `ENDPOINT_URL`
- inputConfig:
- outputPath: all images created by lilsync will be put in this folder. it doesnt have to exist in the bucket
- inputPath: lilsync will look inside this folder and find images to convert
- outputImages: a list of the formats you want to be created. all images from the input folder will have a new image created in the output folder for each format in this section. Requires at least a `width` or `height` to be defined. Available keys: `width`, `height`, `quality`, `ext`
5 changes: 4 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export const getCredentials = (configCredentials?: {

export const getConfig = (): Config => {
try {
const explorerSync = cosmiconfigSync("lilsync");
const explorerSync = cosmiconfigSync("lilsync", {
searchStrategy: "global",
stopDir: "/",
});
const result = explorerSync.search();

if (!result || !result.config) {
Expand Down

0 comments on commit b837899

Please sign in to comment.