Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Releases: mjackson/remix-the-web

file-storage v0.6.1

06 Feb 23:47
Compare
Choose a tag to compare
  • Fix regression when using LocalFileStorage together with form-data-parser (see #53)

tar-parser v0.2.2

04 Feb 01:41
Compare
Choose a tag to compare
  • Add Promise<void> to TarEntryHandler return type

multipart-parser v0.8.2

04 Feb 01:58
Compare
Choose a tag to compare
  • Add Promise<void> to MultipartPartHandler return type

file-storage v0.6.0

04 Feb 01:41
Compare
Choose a tag to compare
  • BREAKING CHANGE: LocalFileStorage now uses 2 characters for shard directory names instead of 8.
  • Buffer contents of files stored in MemoryFileStorage.
  • Add storage.list(options) for listing files in storage.

The following options are available:

  • cursor: An opaque string that allows you to paginate over the keys in storage
  • includeMetadata: If true, include file metadata in the result
  • limit: The maximum number of files to return
  • prefix: Only return keys that start with this string

For example, to list all files under keys that start with user123/:

let result = await storage.list({ prefix: 'user123/' });
console.log(result.files);
// [
//   { key: "user123/..." },
//   { key: "user123/..." },
//   ...
// ]

result.files will be an array of { key: string } objects. To include metadata about each file, use includeMetadata: true.

let result = await storage.list({ prefix: 'user123/', includeMetadata: true });
console.log(result.files);
// [
//   {
//     key: "user123/...",
//     lastModified: 1737955705270,
//     name: "hello.txt",
//     size: 16,
//     type: "text/plain"
//   },
//   ...
// ]

Pagination is done via an opaque cursor property in the list result object. If it is not undefined, there are more files to list. You can list them by passing the cursor back in the options object on the next call. For example, to list all items in storage, you could do something like this:

let result = await storage.list();
console.log(result.files);

while (result.cursor !== undefined) {
  result = await storage.list({ cursor: result.cursor });
  console.log(result.files);
}

Use the limit option to limit how many results you get back in the files array.

multipart-parser v0.8.1

27 Jan 05:54
Compare
Choose a tag to compare
  • Fix bad publish that left a workspace:^ version identifier in package.json

headers v0.10.0

27 Jan 20:01
Compare
Choose a tag to compare

This release contains several improvements to Cookie that bring it more in line with other headers like Accept, AcceptEncoding, and AcceptLanguage.

  • BREAKING CHANGE: cookie.names() and cookie.values() are now getters that return string[] instead of methods that return IterableIterator<string>
  • BREAKING CHANGE: cookie.forEach() calls its callback with (name, value, cookie) instead of (value, name, map)
  • BREAKING CHANGE: cookie.delete(name) returns void instead of boolean
// before
let cookieNames = Array.from(headers.cookie.names());

// after
let cookieNames = headers.cookie.names;

Additionally, this release adds support for the If-None-Match header. This is useful for conditional GET requests where you want to return a response with content only if the ETag has changed.

import { SuperHeaders } from '@mjackson/headers';

function requestHandler(request: Request): Promise<Response> {
  let response = await callDownstreamService(request);

  if (request.method === 'GET' && response.headers.has('ETag')) {
    let headers = new SuperHeaders(request.headers);
    if (headers.ifNoneMatch.matches(response.headers.get('ETag'))) {
      return new Response(null, { status: 304 });
    }
  }

  return response;
}

node-fetch-server v0.5.1

25 Jan 17:48
Compare
Choose a tag to compare
  • Iterate manually over response bodies in sendResponse instead of using for await...of. This seems to avoid an issue where the iterator tries to read from a stream after the lock has been released.

lazy-file v3.3.1

25 Jan 17:50
Compare
Choose a tag to compare
  • Handle stream errors in lazy-file/fs' writeFile. When there is an error in the stream, call writeStream.end() on the underlying file stream before rejecting the promise.

form-data-parser v0.7.0

25 Jan 18:57
Compare
Choose a tag to compare
  • BREAKING CHANGE: Override parseFormData signature so the upload handler is always last in the argument list. parserOptions are now an optional 2nd arg.
import { parseFormData } from '@mjackson/form-data-parser';

// before
await parseFormData(
  request,
  (fileUpload) => {
    // ...
  },
  { maxFileSize },
);

// after
await parseFormData(request, { maxFileSize }, (fileUpload) => {
  // ...
});
  • Upgrade multipart-parser to v0.8 to fix an issue where errors would crash the process when maxFileSize was exceeded (see #28)
  • Add an example of how to use form-data-parser together with file-storage to handle multipart uploads on Node.js
  • Expand FileUploadHandler interface to support returning Blob from the upload handler, which is the superclass of File

file-storage v0.5.0

25 Jan 19:34
Compare
Choose a tag to compare
  • Add fileStorage.put(key, file) method as a convenience around fileStorage.set(key, file) + fileStorage.get(key), which is a very common pattern when you need immediate access to the file you just put in storage
// before
await fileStorage.set(key, file);
let newFile = await fileStorage.get(key)!;

// after
let newFile = await fileStorage.put(key, file);