Comparing version 1.0.0-beta.1 to 1.0.0-beta.2
import { PagefindService } from "./service.js"; | ||
import { decode } from "./encoding.js"; | ||
@@ -215,3 +216,3 @@ /** | ||
index_id: indexId, | ||
bundle_path: options?.bundlePath | ||
output_path: options?.outputPath | ||
}, (response) => { | ||
@@ -226,3 +227,3 @@ /** @type {function(InternalResponsePayload): Omit<WriteFilesResponse, 'errors'>?} */ | ||
return { | ||
bundlePath: success.bundle_path | ||
outputPath: success.output_path | ||
} | ||
@@ -259,3 +260,3 @@ }; | ||
path: file.path, | ||
content: Buffer.from(file.content, 'base64') | ||
content: decode(file.content) | ||
} | ||
@@ -262,0 +263,0 @@ }) |
{ | ||
"name": "pagefind", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"type": "module", | ||
@@ -22,7 +22,7 @@ "description": "Implement search on any static website.", | ||
"optionalDependencies": { | ||
"@pagefind/linux-x64": "1.0.0-beta.1", | ||
"@pagefind/linux-arm64": "1.0.0-beta.1", | ||
"@pagefind/darwin-x64": "1.0.0-beta.1", | ||
"@pagefind/darwin-arm64": "1.0.0-beta.1", | ||
"@pagefind/windows-x64": "1.0.0-beta.1" | ||
"@pagefind/linux-x64": "1.0.0-beta.2", | ||
"@pagefind/linux-arm64": "1.0.0-beta.2", | ||
"@pagefind/darwin-x64": "1.0.0-beta.2", | ||
"@pagefind/darwin-arm64": "1.0.0-beta.2", | ||
"@pagefind/windows-x64": "1.0.0-beta.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "keywords": [ |
@@ -50,3 +50,3 @@ # Pagefind Static Search | ||
await index.writeFiles({ | ||
bundlePath: "./public/pagefind" | ||
outputPath: "./public/pagefind" | ||
}); | ||
@@ -156,3 +156,3 @@ ``` | ||
Get buffers of all files in the Pagefind index. Useful for integrating a Pagefind index into the development mode of a static site generator and hosting these files yourself. | ||
Get raw data of all files in the Pagefind index. Useful for integrating a Pagefind index into the development mode of a static site generator and hosting these files yourself. | ||
@@ -164,3 +164,3 @@ ```js | ||
console.log(file.path); | ||
// do something with file.content | ||
// do something with the file.content Uint8Array | ||
} | ||
@@ -171,3 +171,3 @@ ``` | ||
If successful, `files` will be an array containing file objects. Each object contains a `path` key, which is the URL this file should be served at, and a `content` key containing the raw Buffer of this file. | ||
If successful, `files` will be an array containing file objects. Each object contains a `path` key, which is the URL this file should be served at, and a `content` key containing the raw data as a Uint8Array. | ||
@@ -180,7 +180,7 @@ ### index.writeFiles | ||
const { errors } = await index.writeFiles({ | ||
bundlePath: "./public/pagefind" | ||
outputPath: "./public/pagefind" | ||
}); | ||
``` | ||
The `bundlePath` option should contain the path to the desired Pagefind bundle directory. If relative, is relative to the current working directory of your Node process. | ||
The `outputPath` option should contain the path to the desired Pagefind bundle directory. If relative, is relative to the current working directory of your Node process. | ||
@@ -187,0 +187,0 @@ A response with an `errors` array containing error messages indicates that Pagefind failed to action this request. |
@@ -165,3 +165,3 @@ /** | ||
*/ | ||
bundlePath: string | ||
outputPath: string | ||
} | ||
@@ -172,3 +172,3 @@ | ||
errors: string[], | ||
bundlePath: string | ||
outputPath: string | ||
} | ||
@@ -188,3 +188,3 @@ | ||
path: string, | ||
content: Buffer | ||
content: Uint8Array | ||
} | ||
@@ -191,0 +191,0 @@ |
@@ -65,3 +65,3 @@ // Requests to the backend. | ||
index_id: number, | ||
bundle_path?: string | ||
output_path?: string | ||
} | ||
@@ -128,3 +128,3 @@ | ||
type: 'WriteFiles', | ||
bundle_path: string, | ||
output_path: string, | ||
} | ||
@@ -131,0 +131,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41485
23
858