diff --git a/.changeset/brown-hotels-fetch.md b/.changeset/brown-hotels-fetch.md new file mode 100644 index 0000000..9b0cb3a --- /dev/null +++ b/.changeset/brown-hotels-fetch.md @@ -0,0 +1,7 @@ +--- +"cachu": patch +--- + +docs: rename license, readme and code of conduct + +Change file names to uppercase. diff --git a/code_of_conduct.md b/CODE_OF_CONDUCT.MD similarity index 100% rename from code_of_conduct.md rename to CODE_OF_CONDUCT.MD diff --git a/license b/LICENSE similarity index 99% rename from license rename to LICENSE index 47bf829..ff99434 100644 --- a/license +++ b/LICENSE @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d404fb9 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +
+

cachu

+

+
+ +> **Notice** +Need an introduction to v6? [Here](https://gist.github.com/unvented/dab8d3e987cfdd79f68e715d29c1ee17) you go! + +## Setup + +```bash +# Get the latest release. +npm i cachu + +# Try the latest commit. +npm i cachu@dev +``` + +## Usage + +### Deno + +```typescript +import { useCache } from 'https://deno.land/x/cachu@v6.0.0/mod.ts' + +const cache = await useCache() +``` + +### Node.js + +```js +import { useCache } from 'cachu' + +const cache = await useCache() + +// Add a new entry. +await cache.add('one', 'Hello World') + +const entry = await cache.get('one') // 'Hello World' +``` + +## API + +* #### Configuration + + * [`maxAge`](/guide/config/maxAge.md) to set the **maximum age** for each record in the cache + * [`maxAmount`](/guide/config/maxAmount.md) to set the **maximum size** for the cache + +* #### Features + + * [`add()`](/guide/features/set.md) + * [`addMany()`](/guide/features/setMany.md) + * [`get()`](/guide/features/get.md) + * [`getMany()`](/guide/features/getMany.md) + * [`update()`](/guide/features/update.md) + * [`updateMany()`](/guide/features/updateMany.md) + * [`remove()`](/guide/features/delete.md) + * [`removeMany()`](/guide/features/deleteMany.md) + * [`has()`](/guide/features/has.md) + * [`size()`](/guide/features/size.md) + * [`keys()`](/guide/features/keys.md) + * [`values()`](/guide/features/values.md) + * [`clear()`](/guide/features/clear.md) diff --git a/readme.md b/readme.md deleted file mode 100644 index c7eafd4..0000000 --- a/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -## cachu - -> **Warning** -> cachu v6 is **not yet production-ready** and may contain bugs causing memory leaks. Check out the docs for our stable version [here](https://github.com/azurydev/cachu/tree/v5.x). - -### Setup - -#### Installation - -```bash -# Install the latest (stable) release. -npm i cachu - -# Try out new features before they hit our stable release. -npm i cachu@canary -``` - -#### Usage - -```js -import { MemoryCache } from 'cachu' - -(async () => { - const cache = new MemoryCache() - - // Set a new entry. - await cache.set('one', 'Hello World') - - console.log(await cache.get('one')) // Gives out "Hello World" on console. -})() -``` - -### Caches - -- [`BigCache`](/guide/caches/BigCache.md) *(coming soon)* -- [`MemoryCache`](/guide/caches/MemoryCache.md) -- [`DiskCache`](/guide/caches/DiskCache.md) *(coming soon)* - -### API - -- #### Configuration - - - [`maxAge`](/guide/config/maxAge.md) to set the **maximum age** for each record in the cache - - [`maxAmount`](/guide/config/maxAmount.md) to set the **maximum size** for the cache - -- #### Features - - - [`set(key, value, maxAge)`](/guide/features/set.md) - - [`setMany([[key, value, maxAge]])`](/guide/features/setMany.md) - - [`get(key, config)`](/guide/features/get.md) - - [`getMany([keys], config)`](/guide/features/getMany.md) - - [`update(key, value)`](/guide/features/update.md) - - [`updateMany([[key, value]])`](/guide/features/updateMany.md) - - [`delete(key)`](/guide/features/delete.md) - - [`deleteMany([keys])`](/guide/features/deleteMany.md) - - [`has(key)`](/guide/features/has.md) - - [`size()`](/guide/features/size.md) - - [`keys()`](/guide/features/keys.md) - - [`values()`](/guide/features/values.md) - - [`clear()`](/guide/features/clear.md) - - [`recent()`](/guide/features/recent.md) - - [`maxAge(maxAge)`](/guide/features/maxAge.md) - - [`maxAmount(maxAmount)`](/guide/features/maxAmount.md) - - [`on(event, action)`](/guide/features/on.md)