Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
af5f113
chore: bump dependencies
Cherry Feb 3, 2024
0a51838
chore(deps-dev): bump undici from 5.28.2 to 5.28.3
dependabot[bot] Feb 16, 2024
f7efaa0
Merge pull request #31 from Cherry/dependabot/npm_and_yarn/undici-5.28.3
Cherry Feb 17, 2024
957323e
feat: analytics engine
Cherry Feb 24, 2024
1e18d72
refactor: use @cloudflare/vitest-pool-workers (#32)
Cherry Mar 14, 2024
56a54da
chore: bump dependencies
Cherry Mar 26, 2024
3910bc5
chore(deps-dev): bump undici from 5.28.3 to 5.28.4 (#33)
dependabot[bot] Apr 4, 2024
5ac80bd
chore: bump dependencies
Cherry May 12, 2024
db5b0b3
chore: bump dependencies
Cherry Jun 24, 2024
0680571
chore: bump dependencies
Cherry Jul 7, 2024
538e261
chore: bump dependencies
Cherry Sep 12, 2024
66c2376
chore: bump dependencies
Cherry Sep 14, 2024
172f580
chore(deps): bump vite from 5.4.5 to 5.4.6
dependabot[bot] Sep 17, 2024
b3705d9
Merge pull request #38 from Cherry/dependabot/npm_and_yarn/vite-5.4.6
Cherry Sep 22, 2024
409453c
chore(deps): bump rollup from 4.21.3 to 4.22.4
dependabot[bot] Sep 24, 2024
bbf7616
Merge pull request #39 from Cherry/dependabot/npm_and_yarn/rollup-4.22.4
Cherry Sep 24, 2024
56e5331
fix: Update number of locations everywhere
DaniFoldi Sep 30, 2024
7607f41
Merge pull request #40 from DaniFoldi/locations
Cherry Sep 30, 2024
bcbac21
feat: Add dark mode color overrides
DaniFoldi Sep 30, 2024
4c1de1d
Merge pull request #41 from DaniFoldi/dark-mode
Cherry Sep 30, 2024
ea9f664
chore(deps): bump cookie and youch
dependabot[bot] Oct 16, 2024
bbc2a3b
Merge pull request #42 from Cherry/dependabot/npm_and_yarn/multi-901d…
Cherry Oct 23, 2024
d8ab33f
chore: bump dependencies
Cherry Nov 23, 2024
db194c1
refactor: move to Workers Assets (#43)
Cherry Dec 20, 2024
1ab582a
docs: update technology
Cherry Dec 20, 2024
0fb80bc
feat: add more simple URL format support
Cherry Dec 28, 2024
8f39ee0
docs: update README
Cherry Dec 28, 2024
ea64ae1
chore: bump dependencies
Cherry Mar 1, 2025
9b2e140
fix: use up to date wrangler version in CI (#47)
Cherry Mar 2, 2025
fd86a77
fix: use integration style tests for assets
Cherry Mar 3, 2025
666601e
chore: bump to wrangler 4
Cherry Mar 13, 2025
c6c2828
chore: bump dependencies
Cherry Mar 23, 2025
37e71c4
fix: use more common charset
Cherry Mar 29, 2025
ff8a988
fix: handle apostrophes (#52)
Cherry Apr 17, 2025
49836f0
chore: bump dependencies
Cherry Sep 22, 2025
2f5fd8d
chore: disable tracing
Cherry Sep 23, 2025
53ae111
chore: bump dependencies
Cherry Oct 1, 2025
99aea1c
chore: enable tracing
Cherry Oct 6, 2025
b282d17
feat: new homepage design
Cherry Dec 15, 2025
7b596e1
fix: newline example on homepage
Cherry Dec 22, 2025
d98171e
chore(deps): bump lodash from 4.17.21 to 4.17.23 (#59)
dependabot[bot] Jan 23, 2026
a679b7e
chore: disable wrangler telemetry (#63)
Cherry Mar 6, 2026
ecc7fdd
chore: eslint v10 migration (#65)
Cherry Mar 12, 2026
6c9d705
chore: vitest v4 migration (#66)
Cherry Mar 13, 2026
363c168
chore: bump dependencies
Cherry Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions .eslintrc.json

This file was deleted.

26 changes: 5 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
repository_dispatch:

env:
NODE_VERSION: 20.x
NODE_VERSION: 22.x
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -17,15 +17,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Restore NPM cache
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- run: npm ci
- run: npm run lint
Expand All @@ -43,20 +35,12 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Restore NPM cache
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- run: npm ci

- name: Publish
uses: cloudflare/wrangler-action@v3.3.2
uses: cloudflare/wrangler-action@v3.14.1
# only publish if a direct `push`/`repository_dispatch`
# publish non-production deploy if it's a fork
if: github.event_name == 'repository_dispatch' || github.event_name == 'push' && github.repository_owner != 'Cherry'
Expand All @@ -66,7 +50,7 @@ jobs:
command: "deploy"

- name: Publish (production)
uses: cloudflare/wrangler-action@v3.3.2
uses: cloudflare/wrangler-action@v3.14.1
# only publish if a direct `push`/`repository_dispatch`
# publish production deploy if it's the original repository
if: (github.event_name == 'repository_dispatch' || github.event_name == 'push') && github.repository_owner == 'Cherry'
Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# [placeholders.dev](https://placeholders.dev)
Generate super-fast placeholder images in 270+ edge locations, powered by Cloudflare Workers
![350x150 placeholder image](https://images.placeholders.dev/?width=350&height=100)![200x100 placeholder image](https://images.placeholders.dev/?width=200&height=100&bgColor=%23000&textColor=rgba(255,255,255,0.5))![140x100 placeholder image](https://images.placeholders.dev/?width=140&height=100&bgColor=%23313131&textColor=%23dfdfde)
Generate super-fast placeholder images in 330+ edge locations, powered by Cloudflare Workers
![350x150 placeholder image](https://images.placeholders.dev/350x100)![200x100 placeholder image](https://images.placeholders.dev/?width=200&height=100&bgColor=%23000&textColor=rgba(255,255,255,0.5))![140x100 placeholder image](https://images.placeholders.dev/?width=140&height=100&bgColor=%23313131&textColor=%23dfdfde)
![1055x100 placeholder image](https://images.placeholders.dev/?width=1055&height=100&text=Hello%20World&bgColor=%23434343&textColor=%23dfdfde)

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/Cherry/placeholders.dev)

## Info

placeholders.dev generates custom placeholder images on the fly, such as the examples above. All of these images are generated on Cloudflare's Edge, at 200+ locations, ensuring the best possible performance for all of your users. All images are cached for lengthy periods of time.
placeholders.dev generates custom placeholder images on the fly, such as the examples above. All of these images are generated on Cloudflare's Edge, at 330+ locations, ensuring the best possible performance for all of your users. All images are cached for lengthy periods of time.

## Technology

This project makes use of Cloudflare Workers, and Cloudflare Workers Sites via Workers KV. It also implements a HTMLRewriter to update the total Cloudflare PoPs in multiple locations.
This project makes use of Cloudflare Workers, and Cloudflare Workers Static Assets. It also implements a HTMLRewriter to update the total Cloudflare PoPs in multiple locations.

### Example URLs:

- Basic url path: `https://images.placeholders.dev/350`
- Full url path: `https://images.placeholders.dev/350x150`
- Full query params:`https://images.placeholders.dev/?width=1055&height=100&text=Made%20with%20placeholders.dev&bgColor=%23f7f6f6&textColor=%236d6e71`

### Available API Options

Expand All @@ -36,16 +42,8 @@ This project makes use of Cloudflare Workers, and Cloudflare Workers Sites via W
- `textWrap`
- Wrap text to fit within the image (to best ability). Will not alter font size, so especially long strings may still appear outside of the image. Defaults to `false`.

Example URL: `https://images.placeholders.dev/?width=1055&height=100&text=Made%20with%20placeholders.dev&bgColor=%23f7f6f6&textColor=%236d6e71`
## Dev

### Prerequisites

#### Wrangler
`wrangler` is a CLI tool from Cloudflare, designed to push projects to Cloudflare Workers. See [Cloudflare's documentation](https://developers.cloudflare.com/workers/wrangler/install-and-update/) for more information.

### Run

- `npm run start:dev` (this will use `wrangler dev` to locally start the Cloudflare Worker for testing)

or
Expand Down
35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import nodecraft from '@nodecraft/eslint-config';

const jsonIgnore = ['**/*.json'];
const withJsonIgnore = function(configs) {
return configs.map(function(config) {
return {
...config,
ignores: [...(config.ignores || []), ...jsonIgnore],
};
});
};

export default [
// Global ignores
{
ignores: [
'dist/**',
'.wrangler/**',
],
},

// TypeScript config (includes base), excluding JSON files
...withJsonIgnore(nodecraft.configs.typescript),

// JSON
...nodecraft.configs.json,

// Overrides
{
ignores: jsonIgnore,
rules: {
'n/no-unsupported-features/node-builtins': 'off',
},
},
];
Loading