@netlify/blobs
Advanced tools
Comparing version
@@ -657,3 +657,3 @@ // src/environment.ts | ||
await fs.mkdir(dirname(dataPath), { recursive: true }); | ||
await fs.rename(tempDataPath, dataPath); | ||
await fs.copyFile(tempDataPath, dataPath); | ||
await fs.rm(tempDirectory, { force: true, recursive: true }); | ||
@@ -660,0 +660,0 @@ await fs.mkdir(dirname(metadataPath), { recursive: true }); |
{ | ||
"name": "@netlify/blobs", | ||
"version": "6.3.1", | ||
"version": "6.4.0", | ||
"description": "A JavaScript client for the Netlify Blob Store", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -54,2 +54,26 @@ [](https://github.com/netlify/blobs/actions) | ||
#### Lambda compatibility mode | ||
The environment is not configured automatically when running functions in the | ||
[Lambda compatibility mode](https://docs.netlify.com/functions/lambda-compatibility). To use Netlify Blobs, you must | ||
initialize the environment manually by calling the `connectLambda` method with the Lambda event as a parameter. | ||
You should call this method immediately before calling `getStore` or `getDeployStore`. | ||
```ts | ||
import { connectLambda, getStore } from '@netlify/blobs' | ||
export const handler = async (event) => { | ||
connectLambda(event) | ||
const store = getStore('my-store') | ||
const value = await store.get('my-key') | ||
return { | ||
statusCode: 200, | ||
body: value, | ||
} | ||
} | ||
``` | ||
### API access | ||
@@ -56,0 +80,0 @@ |
Sorry, the diff of this file is not supported yet
90563
0.78%449
5.65%