Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

Change path.join() to path.resolve() to have full paths, bumped package.json version

Jan Curnfaa7db9de80f
diff --git a/package.json b/package.json
index 701f399ac..aa4e288d0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "apify",
- "version": "0.4.19",
+ "version": "0.4.20",
"description": "Apify runtime for JavaScript",
"main": "build/index.js",
"keywords": [
diff --git a/src/actor.js b/src/actor.js
index 39d702784..c694ae2c3 100644
--- a/src/actor.js
+++ b/src/actor.js
@@ -64,7 +64,7 @@ export const getValue = (key, callback = null) => {
// We're emulating KV store locally in a directory to simplify development
const contentType = process.env[ENV_VARS.DEV_KEY_VALUE_STORE_CONTENT_TYPE] || 'application/json';
- const filePath = path.join(devDir, key);
+ const filePath = path.resolve(devDir, key);
promise = newPromise()
.then(() => {
return readFilePromised(filePath);
@@ -162,7 +162,7 @@ export const setValue = (key, value, options, callback = null) => {
if (devDir) {
// We're emulating KV store locally in a directory to simplify development
- const filePath = path.join(devDir, key);
+ const filePath = path.resolve(devDir, key);
innerPromise = writeFilePromised(filePath, value);
} else {
// Keep this code in main scope so that simple errors are thrown rather than rejected promise.
@@ -181,7 +181,7 @@ export const setValue = (key, value, options, callback = null) => {
}
if (devDir) {
// We're emulating KV store locally in a directory to simplify development
- const filePath = path.join(devDir, key);
+ const filePath = path.resolve(devDir, key);
innerPromise = unlinkPromised(filePath);
} else {
innerPromise = apifyClient.keyValueStores.deleteRecord({