repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/docs/assets/js/pixelsjs_demo_tool.js | docs/assets/js/pixelsjs_demo_tool.js | (function () {
var c;
var ctx;
var tiles;
var img;
var canvas_list = [];
var current_img_url = "./city1.PNG"
var current_canvas;
var imgData;
var original_img_data;
var change = 0;
var isFirst = 0;
var i;
document.addEventListener('DOMContentLoaded', init, false);
... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/docs/assets/js/filtering.js | docs/assets/js/filtering.js | (function () {
var c;
var ctx;
var tiles;
var img;
var canvas_list = [];
var current_img_url = "./city1.PNG"
var current_canvas;
var imgData;
var original_img_data;
var change = 0;
var i;
document.addEventListener('DOMContentLoaded', init, false);
function init() {
... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/docs/assets/js/highlight/highlight.pack.js | docs/assets/js/highlight/highlight.pack.js | /*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */
!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/docs/dist/Pixels.js | docs/dist/Pixels.js | !function(a,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pixelsJS=t():a.pixelsJS=t()}(this,function(){return function(a){var t={};function e(d){if(t[d])return t[d].exports;var n=t[d]={i:d,l:!1,exports:{}};retu... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/examples/node/Pixels.js | examples/node/Pixels.js | !function(a,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):"object"==typeof exports?exports.pixelsJS=t(require("lodash")):a.pixelsJS=t(a._)}(this,function(a){return function(a){var t={};function d(n){if(t[n])return t[n]... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/examples/node/example.js | examples/node/example.js |
var filterMagic = require('Pixels.js');
const pureimage = require("pureimage");
var out = function() {
var img1 = pureimage.make(100, 50);
var ctx = img1.getContext('2d');
ctx.fillStyle = 'rgba(255,0,0, 0.5)';
var imgData = ctx.getImageData(0, 0, img1.height, img1.width);
imgData = pixelsJS.filte... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/examples/browser/Pixels.js | examples/browser/Pixels.js | !function(a,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pixelsJS=t():a.pixelsJS=t()}(this,function(){return function(a){var t={};function e(d){if(t[d])return t[d].exports;var n=t[d]={i:d,l:!1,exports:{}};retu... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/examples/browser/script.js | examples/browser/script.js | (function () {
document.addEventListener('DOMContentLoaded', init, false);
function init() {
console.log("init")
var img = document.getElementById("img");
img.crossOrigin = "Anonymous";
img.onload = function () {
pixelsJS.filterImg(img, "neue");
}
v... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/colour_tints.js | lib/colour_tints.js | let i;
import {getRandomNumber} from "./helpers.js"
const lemon_imgdata = (imgData) => {
for (i = 0; i < imgData.data.length; i += 4) {
imgData.data[i + 1] = imgData.data[i] + 50;
}
return imgData;
}
const coral_imgdata = (imgData) => {
for (i = 0; i < imgData.data.length; i += 4) {
im... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/gamma.js | lib/gamma.js | let i;
// These gamma functions provide a slight darkening effect and a colour tint.
const gamma = (imgData) => {
for (i = 0; i < imgData.data.length; i += 4) {
imgData.data[i] = Math.pow(imgData.data[i] / 255, 5) * 255;
imgData.data[i + 1] = Math.pow(imgData.data[i + 1] / 255, 5) * 255;
i... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/line_generators.js | lib/line_generators.js | import {getRandomNumber} from "./helpers.js"
let i;
const add_horizontal_line_imgdata = (imgData) => {
let inc = 0;
for (i = 0; i < imgData.data.length; i += 4) {
inc += 1;
if (inc > 255) {
inc = 0;
}
let avg = (imgData.data[i] + imgData.data[i + 1] + imgData.data[i ... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/index.js | lib/index.js | var imgData;
let i, addition, addition1, addition2;
import * as brightness_adj from "./brightness_adjs";
import * as colour_tints from "./colour_tints";
import * as gamma from "./gamma";
import * as line_gen from "./line_generators";
import * as misc from "./miscellaneous";
import * as noise_gen from "./noise_generator... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/brightness_adjs.js | lib/brightness_adjs.js | import {getRandomNumber} from "./helpers.js"
let i, addition1, addition2, addition;
const darkify_imgdata = (imgData, dec_amt) => {
let BRIGHTNESS_ADJ = dec_amt;
for (i = 0; i < imgData.data.length; i += 4) {
if (imgData.data[i] - BRIGHTNESS_ADJ >= 0) {
imgData.data[i] -= BRIGHTNESS_ADJ;
... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/noise_generators.js | lib/noise_generators.js | import {getRandomNumber} from "./helpers.js"
let i, addition, addition1, addition2;
const green_med_noise_imgdata = (imgData) => {
let rand = (0.5 - Math.random()) * 9;
for (i = 0; i < imgData.data.length; i += 4) {
let randomColor1 = 0.6 + Math.random() * 0.5;
let randomColor2 = 0.6 + Math.r... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/helpers.js | lib/helpers.js | const getRandomNumber = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
export {getRandomNumber} | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/specks_generators.js | lib/specks_generators.js | import {getRandomNumber} from "./helpers.js"
let i, addition, addition1, addition2;
const casino_imgdata = (imgData) => {
let inc = 0;
for (i = 0; i < imgData.data.length; i += 4) {
inc = getRandomNumber(0, 255);
if (inc > 255) {
inc = 0;
}
let avg = (imgData.data... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/offset_filters.js | lib/offset_filters.js | import {getRandomNumber} from "./helpers.js"
let i;
const extreme_offset_blue = (imgData) => {
for (i = 0; i < imgData.data.length; i += 4) {
var offset = 35;
imgData.data[i + 2] = imgData.data[i + 4 * offset * offset] == undefined ? 0 : imgData.data[i + 4 * offset];
}
return imgData;
}
co... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/lib/miscellaneous.js | lib/miscellaneous.js | /**
* @param {number} threshold - influences darkness with 0 being completely black and 255 being completely white. Values inbetween produce a black and white image with varying outlines. Default value of 100.
*/
const threshold = (imgData, threshold = 100) => {
for (let i = 0; i < imgData.data.length; i += 4) {... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
silvia-odwyer/pixels.js | https://github.com/silvia-odwyer/pixels.js/blob/e22132890760e55330dcbd5bfd0d58965c835256/dist/Pixels.js | dist/Pixels.js | !function(a,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pixelsJS=t():a.pixelsJS=t()}(this,(function(){return function(a){var t={};function e(d){if(t[d])return t[d].exports;var n=t[d]={i:d,l:!1,exports:{}};ret... | javascript | Apache-2.0 | e22132890760e55330dcbd5bfd0d58965c835256 | 2026-01-05T03:44:55.933932Z | false |
guardian/elk-stack | https://github.com/guardian/elk-stack/blob/f3eed7b961eaa145a6f93526101ec24265524af4/src/app.js | src/app.js | var express = require('express')
var http = require('http')
var fs = require('fs')
var config = require('./config')
var auth = require('./lib/auth')
var sessions = require("client-sessions")
var app = express()
console.log('Logcabin starting...')
app.use(sessions({ cookieName: 'session', secret: config.cookie_secret... | javascript | Apache-2.0 | f3eed7b961eaa145a6f93526101ec24265524af4 | 2026-01-05T03:45:23.551497Z | false |
guardian/elk-stack | https://github.com/guardian/elk-stack/blob/f3eed7b961eaa145a6f93526101ec24265524af4/src/lib/auth.js | src/lib/auth.js | var request = require('request')
var passport = require('passport')
var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy
exports.setup = function(express, app, config) {
console.log('Google OAuth2 authentication used')
passport.serializeUser(function(user, done) {
done(null, user)
... | javascript | Apache-2.0 | f3eed7b961eaa145a6f93526101ec24265524af4 | 2026-01-05T03:45:23.551497Z | false |
guardian/elk-stack | https://github.com/guardian/elk-stack/blob/f3eed7b961eaa145a6f93526101ec24265524af4/extra/docker/kibana-config.js | extra/docker/kibana-config.js | /** @scratch /configuration/config.js/1
*
* == Configuration
* config.js is where you will find the core Kibana configuration. This file contains parameter that
* must be set before kibana is run for the first time.
*/
define(['settings'],
function (Settings) {
/** @scratch /configuration/config.js/2
*
... | javascript | Apache-2.0 | f3eed7b961eaa145a6f93526101ec24265524af4 | 2026-01-05T03:45:23.551497Z | false |
guardian/elk-stack | https://github.com/guardian/elk-stack/blob/f3eed7b961eaa145a6f93526101ec24265524af4/config/config.js | config/config.js | module.exports = {
'host': '@@LOGCABIN_HOST',
'listen_port': 8080,
'apiKey': '@@API_KEY',
'cookie_secret': '@@COOKIE_SECRET',
'oauth_unauthenticated': ['/__es/', '/__es/_cat/health'],
'oauth_application_name': 'logcabin',
'oauth_client_id': '@@CLIENT_ID',
'oauth_client_secret': '@@CLIEN... | javascript | Apache-2.0 | f3eed7b961eaa145a6f93526101ec24265524af4 | 2026-01-05T03:45:23.551497Z | false |
takahirox/wgpu-rust-renderer | https://github.com/takahirox/wgpu-rust-renderer/blob/2b36c0af2f70a110e0897777e5e781c4cff8810e/web/examples/cube/wgpu_rust_renderer_example_cube.js | web/examples/cube/wgpu_rust_renderer_example_cube.js |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret... | javascript | MIT | 2b36c0af2f70a110e0897777e5e781c4cff8810e | 2026-01-05T03:45:17.630544Z | true |
takahirox/wgpu-rust-renderer | https://github.com/takahirox/wgpu-rust-renderer/blob/2b36c0af2f70a110e0897777e5e781c4cff8810e/web/examples/face_culling/wgpu_rust_renderer_example_face_culling.js | web/examples/face_culling/wgpu_rust_renderer_example_face_culling.js |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret... | javascript | MIT | 2b36c0af2f70a110e0897777e5e781c4cff8810e | 2026-01-05T03:45:17.630544Z | true |
takahirox/wgpu-rust-renderer | https://github.com/takahirox/wgpu-rust-renderer/blob/2b36c0af2f70a110e0897777e5e781c4cff8810e/web/examples/gltf/wgpu_rust_renderer_example_gltf.js | web/examples/gltf/wgpu_rust_renderer_example_gltf.js |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret... | javascript | MIT | 2b36c0af2f70a110e0897777e5e781c4cff8810e | 2026-01-05T03:45:17.630544Z | true |
takahirox/wgpu-rust-renderer | https://github.com/takahirox/wgpu-rust-renderer/blob/2b36c0af2f70a110e0897777e5e781c4cff8810e/web/examples/texture/wgpu_rust_renderer_example_texture.js | web/examples/texture/wgpu_rust_renderer_example_texture.js |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret... | javascript | MIT | 2b36c0af2f70a110e0897777e5e781c4cff8810e | 2026-01-05T03:45:17.630544Z | true |
takahirox/wgpu-rust-renderer | https://github.com/takahirox/wgpu-rust-renderer/blob/2b36c0af2f70a110e0897777e5e781c4cff8810e/web/examples/triangle/wgpu_rust_renderer_example_triangle.js | web/examples/triangle/wgpu_rust_renderer_example_triangle.js |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret... | javascript | MIT | 2b36c0af2f70a110e0897777e5e781c4cff8810e | 2026-01-05T03:45:17.630544Z | true |
takahirox/wgpu-rust-renderer | https://github.com/takahirox/wgpu-rust-renderer/blob/2b36c0af2f70a110e0897777e5e781c4cff8810e/web/examples/rotation/wgpu_rust_renderer_example_rotation.js | web/examples/rotation/wgpu_rust_renderer_example_rotation.js |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret... | javascript | MIT | 2b36c0af2f70a110e0897777e5e781c4cff8810e | 2026-01-05T03:45:17.630544Z | true |
tsers-js/core | https://github.com/tsers-js/core/blob/f1a1a497a122a894a394e858a0b325f413fa8081/src/index.js | src/index.js | import Rx, {Observable as O} from "rx"
const noop = () => undefined
const objKeys = x =>
x ? Object.keys(x) : []
const extend = Object.assign
const isFun = x => typeof x === "function"
const isObj = x => typeof x === "object" && x.constructor === Object
const keyNotIn = keys => {
const hash = keys.reduce((acc,... | javascript | MIT | f1a1a497a122a894a394e858a0b325f413fa8081 | 2026-01-05T03:45:17.255581Z | false |
tsers-js/core | https://github.com/tsers-js/core/blob/f1a1a497a122a894a394e858a0b325f413fa8081/test/tsers.js | test/tsers.js | import should from "should"
import Rx, {Observable as O} from "rx"
import TSERS, {mux} from "../src/index"
const noop = () => undefined
const interpreter = executor => () => [null, executor]
describe("TSERS(main, interpreters)", () => {
it("requires interpreters to be an object", () => {
should.throws(() => T... | javascript | MIT | f1a1a497a122a894a394e858a0b325f413fa8081 | 2026-01-05T03:45:17.255581Z | false |
tsers-js/core | https://github.com/tsers-js/core/blob/f1a1a497a122a894a394e858a0b325f413fa8081/test/transforms.js | test/transforms.js | import "should"
import Rx, {Observable as O} from "rx"
import {mux, demux, loop, mapListBy, demuxCombined} from "../src/index"
const noop = () => undefined
const mapListById = mapListBy.bind(null, x => x.id)
describe("common signal transformers", () => {
describe("demux(out$, ...keys)", () => {
it("decompose... | javascript | MIT | f1a1a497a122a894a394e858a0b325f413fa8081 | 2026-01-05T03:45:17.255581Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/docs/next.config.js | docs/next.config.js | const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});
module.exports = withNextra();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-13/next.config.js | examples/next-13/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-13/pages/_document.js | examples/next-13/pages/_document.js | import Document, { Head, Html, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-13/pages/index.js | examples/next-13/pages/index.js | import Head from "next/head";
import Link from "next/link";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
<Link href="/about">About</Link>
</>
);
export default Index;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-13/pages/about.js | examples/next-13/pages/about.js | import Head from "next/head";
import Link from "next/link";
const About = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>About</h1>
<Link href="/">Home</Link>
</>
);
export default About;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback-v2/next.config.js | examples/offline-fallback-v2/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
fallbacks: {
image: "/static/images/fallback.png",
// document: '/other-offline', // if you want to fallback to a custom page other than /_offline
// font: '/static/font/fallback.woff2',
// audio: ...,
// video: ...,
},
});
module... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback-v2/.eslintrc.js | examples/offline-fallback-v2/.eslintrc.js | module.exports = {
extends: "next/core-web-vitals",
parserOptions: {
babelOptions: {
presets: [require.resolve("next/babel")],
},
},
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback-v2/pages/_document.js | examples/offline-fallback-v2/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback-v2/pages/index.js | examples/offline-fallback-v2/pages/index.js | import Head from "next/head";
import Image from "next/image";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
<h2>Routes not cached will fallback to /_offline page</h2>
<h2>Following image will fallback to placeholder when offline</h... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback-v2/pages/_offline.js | examples/offline-fallback-v2/pages/_offline.js | import Head from "next/head";
const Fallback = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>This is offline fallback page</h1>
<h2>When offline, any page route will fallback to this page</h2>
</>
);
export default Fallback;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cookie/next.config.js | examples/cookie/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
dynamicStartUrl: true, // this is same as default value
dynamicStartUrlRedirect: "/login", // recommend to config this for best user experience if your start-url redirects on first load
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cookie/pages/_document.js | examples/cookie/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cookie/pages/index.js | examples/cookie/pages/index.js | import Head from "next/head";
import { useRouter } from "next/router";
import Cookies from "js-cookie";
import nextCookies from "next-cookies";
const Index = ({ user }) => {
const router = useRouter();
const handleLogoutClick = () => {
Cookies.remove("user");
router.replace("/login");
};
const handle... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cookie/pages/login.js | examples/cookie/pages/login.js | import Head from "next/head";
import { useRouter } from "next/router";
import Cookies from "js-cookie";
const Login = () => {
const router = useRouter();
const handleLoginClick = () => {
Cookies.set("user", "FakeUserID-0527VND927SDF", { expires: 30 });
router.replace("/");
};
return (
<>
<H... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/web-push/next.config.js | examples/web-push/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/web-push/worker/index.js | examples/web-push/worker/index.js | "use strict";
self.addEventListener("push", function (event) {
const data = JSON.parse(event.data.text());
event.waitUntil(
registration.showNotification(data.title, {
body: data.message,
icon: "/icons/android-chrome-192x192.png",
})
);
});
self.addEventListener("notificationclick", function... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/web-push/pages/_document.js | examples/web-push/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/web-push/pages/index.js | examples/web-push/pages/index.js | import { useEffect, useState } from "react";
import Head from "next/head";
const base64ToUint8Array = (base64) => {
const padding = "=".repeat((4 - (base64.length % 4)) % 4);
const b64 = (base64 + padding).replace(/-/g, "+").replace(/_/g, "/");
const rawData = window.atob(b64);
const outputArray = new Uint8Ar... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/web-push/pages/api/notification.js | examples/web-push/pages/api/notification.js | const webPush = require("web-push");
webPush.setVapidDetails(
`mailto:${process.env.WEB_PUSH_EMAIL}`,
process.env.NEXT_PUBLIC_WEB_PUSH_PUBLIC_KEY,
process.env.WEB_PUSH_PRIVATE_KEY
);
const Notification = (req, res) => {
if (req.method == "POST") {
const { subscription } = req.body;
webPush
.sen... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback/next.config.js | examples/offline-fallback/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
swSrc: "service-worker.js",
});
module.exports = withPWA({
images: {
domains: ["source.unsplash.com"],
},
});
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback/.eslintrc.js | examples/offline-fallback/.eslintrc.js | module.exports = {
extends: "next/core-web-vitals",
parserOptions: {
babelOptions: {
presets: [require.resolve("next/babel")],
},
},
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback/service-worker.js | examples/offline-fallback/service-worker.js | import { skipWaiting, clientsClaim } from "workbox-core";
import { ExpirationPlugin } from "workbox-expiration";
import {
NetworkOnly,
NetworkFirst,
CacheFirst,
StaleWhileRevalidate,
} from "workbox-strategies";
import {
registerRoute,
setDefaultHandler,
setCatchHandler,
} from "workbox-routing";
import {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback/pages/_document.js | examples/offline-fallback/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback/pages/index.js | examples/offline-fallback/pages/index.js | import Head from "next/head";
import Image from "next/image";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
<h2>Routes not cached will fallback to /_offline page</h2>
<h2>Following image will fallback to placeholder when offline</h... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/offline-fallback/pages/fallback.js | examples/offline-fallback/pages/fallback.js | import Head from "next/head";
const Fallback = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>This is offline fallback page</h1>
<h2>When offline, any route will fallback to this page</h2>
</>
);
export default Fallback;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/lifecycle/next.config.js | examples/lifecycle/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
register: false,
skipWaiting: false,
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/lifecycle/pages/_document.js | examples/lifecycle/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/lifecycle/pages/index.js | examples/lifecycle/pages/index.js | import { useEffect } from "react";
import Head from "next/head";
const Index = () => {
// This hook only run once in browser after the component is rendered for the first time.
// It has same effect as the old componentDidMount lifecycle callback.
useEffect(() => {
if (
typeof window !== "undefined" &&... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/minimal/next.config.js | examples/minimal/next.config.js | const withPWA = require("@imbios/next-pwa")({
// pwa output folder
// dest: '.next/pwa'
//
// Other configurations:
// ...
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/minimal/index.js | examples/minimal/index.js | const { join } = require("path");
const { parse } = require("url");
const fs = require("fs");
const fastify = require("fastify")({
logger: false,
});
const Next = require("next");
const nextConfig = require("./next.config");
const port = parseInt(process.env.PORT, 10) || 3000;
const dev = process.env.NODE_ENV !== "p... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/minimal/pages/_document.js | examples/minimal/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/minimal/pages/index.js | examples/minimal/pages/index.js | import Head from "next/head";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
</>
);
export default Index;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/app-dir/next.config.js | examples/app-dir/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
/** @type {import("next").NextConfig} */
module.exports = withPWA({
reactStrictMode: true,
experimental: {
appDir: true,
},
});
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker-webpack/next.config.js | examples/custom-worker-webpack/next.config.js | const path = require("path");
const withPWA = require("@imbios/next-pwa")({
dest: "public",
customWorkerWebpack(config) {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
"@util": path.resolve(__dirname, "./util"),
},
... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker-webpack/.eslintrc.js | examples/custom-worker-webpack/.eslintrc.js | module.exports = {
extends: "next/core-web-vitals",
parserOptions: {
babelOptions: {
presets: [require.resolve("next/babel")],
},
},
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker-webpack/util/index.js | examples/custom-worker-webpack/util/index.js | "use strict";
module.exports = () => {
console.log("Hello from util.");
console.log("es6+ syntax test:");
let foo = { message: "working" };
console.log(foo?.message);
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker-webpack/worker/index.js | examples/custom-worker-webpack/worker/index.js | "use strict";
// To disable all workbox logging during development, you can set self.__WB_DISABLE_DEV_LOGS to true
// https://developers.google.com/web/tools/workbox/guides/configure-workbox#disable_logging
//
// self.__WB_DISABLE_DEV_LOGS = true
const util = require("@util");
util();
// listen to message event fro... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker-webpack/pages/_document.js | examples/custom-worker-webpack/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker-webpack/pages/index.js | examples/custom-worker-webpack/pages/index.js | import Head from "next/head";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
</>
);
export default Index;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/next.config.js | examples/cache-on-front-end-nav/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/worker/index.js | examples/cache-on-front-end-nav/worker/index.js | "use strict";
self.addEventListener("message", async (event) => {
if (event.data && event.data.action === "CACHE_NEW_ROUTE") {
caches.open("others").then((cache) =>
cache.match(event.source.url).then((res) => {
if (res === undefined) {
return cache.add(event.source.url);
}
}... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/pages/_document.js | examples/cache-on-front-end-nav/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/pages/_app.js | examples/cache-on-front-end-nav/pages/_app.js | import React, { useEffect, useState } from "react";
import { useRouter } from "next/router";
const _App = ({ Component, pageProps }) => {
const [isOnline, setIsOnline] = useState(true);
useEffect(() => {
if (
typeof window !== "undefined" &&
"ononline" in window &&
"onoffline" in window
)... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/pages/index.js | examples/cache-on-front-end-nav/pages/index.js | import Head from "next/head";
import Link from "next/link";
const Index = () => (
<>
<Head>
<title>next-pwa example | Home</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
<h2>
<Link href="/">Go to Home</Link>
</h2>
<h2>
<Link href="/a">Go to route /a</Link>
</h2>
<... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/pages/b.js | examples/cache-on-front-end-nav/pages/b.js | import Head from "next/head";
import Link from "next/link";
const B = () => (
<>
<Head>
<title>next-pwa example | Route b</title>
</Head>
<h1>This is route /b</h1>
<h2>
<Link href="/">Go to Home</Link>
</h2>
<h2>
<Link href="/a">Go to route /a</Link>
</h2>
<h2>
... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/cache-on-front-end-nav/pages/a.js | examples/cache-on-front-end-nav/pages/a.js | import Head from "next/head";
import Link from "next/link";
const A = () => (
<>
<Head>
<title>next-pwa example | Route a</title>
</Head>
<h1>This is route /a</h1>
<h2>
<Link href="/">Go to Home</Link>
</h2>
<h2>
<Link href="/a">Go to route /a</Link>
</h2>
<h2>
... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker/next.config.js | examples/custom-worker/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker/worker/index.js | examples/custom-worker/worker/index.js | "use strict";
// To disable all workbox logging during development, you can set self.__WB_DISABLE_DEV_LOGS to true
// https://developers.google.com/web/tools/workbox/guides/configure-workbox#disable_logging
//
// self.__WB_DISABLE_DEV_LOGS = true
const util = require("./util");
util();
// listen to message event fr... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker/worker/util.js | examples/custom-worker/worker/util.js | "use strict";
module.exports = () => {
console.log("Hello from util.");
console.log("es6+ syntax test:");
let foo = { message: "working" };
console.log(foo?.message);
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker/pages/_document.js | examples/custom-worker/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-worker/pages/index.js | examples/custom-worker/pages/index.js | import Head from "next/head";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
</>
);
export default Index;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-i18next/next-utils.config.js | examples/next-i18next/next-utils.config.js | const pc = require("picocolors");
const nextUtilsConfig = () => {
const trueEnv = ["true", "1", "yes"];
const esmExternals = trueEnv.includes(
process.env?.NEXTJS_ESM_EXTERNALS ?? "false"
);
const tsconfigPath = process.env.NEXTJS_TSCONFIG_PATH
? process.env.NEXTJS_TSCONFIG_PATH
: "./tsconfig.json"... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-i18next/next.config.js | examples/next-i18next/next.config.js | // @ts-check
const { i18n } = require("./next-i18next.config.js");
// You can remove the following 2 lines when integrating our example.
const { loadCustomBuildParams } = require("./next-utils.config");
const { esmExternals = false, tsconfigPath } = loadCustomBuildParams();
// TODO: Work on the Typescript support
// ... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-i18next/next-i18next.config.js | examples/next-i18next/next-i18next.config.js | // @ts-check
/**
* @type {import('next-i18next').UserConfig}
*/
module.exports = {
// https://www.i18next.com/overview/configuration-options#logging
debug: process.env.NODE_ENV === "development",
i18n: {
defaultLocale: "en",
locales: ["en", "de"],
},
/** To avoid issues when deploying to some paas ... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/custom-ts-worker/next.config.js | examples/custom-ts-worker/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-image/next.config.js | examples/next-image/next.config.js | const withPWA = require("@imbios/next-pwa")({
dest: "public",
});
module.exports = withPWA();
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-image/pages/_document.js | examples/next-image/pages/_document.js | import Document, { Html, Head, Main, NextScript } from "next/document";
const APP_NAME = "next-pwa example";
const APP_DESCRIPTION = "This is an example of using next-pwa plugin";
class _Document extends Document {
static async getInitialProps(ctx) {
return await Document.getInitialProps(ctx);
}
render() {... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-image/pages/index.js | examples/next-image/pages/index.js | import Head from "next/head";
import Link from "next/link";
import Image from "next/image";
import nextjsDark from "../images/nextjs-dark.svg";
const Index = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>Next.js + PWA = AWESOME!</h1>
<Image src={nextjsDark} width={504} height={... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/examples/next-image/pages/about.js | examples/next-image/pages/about.js | import Head from "next/head";
import Link from "next/link";
const About = () => (
<>
<Head>
<title>next-pwa example</title>
</Head>
<h1>About</h1>
<Link href="/">Home</Link>
</>
);
export default About;
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/next-pwa/index.js | packages/next-pwa/index.js | "use strict";
const path = require("path");
const fs = require("fs");
const globby = require("globby");
const crypto = require("crypto");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const WorkboxPlugin = require("workbox-webpack-plugin");
const defaultCache = require("./cache");
const buildCustomWo... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/next-pwa/cache.js | packages/next-pwa/cache.js | "use strict";
// Workbox RuntimeCaching config: https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.RuntimeCachingEntry
module.exports = [
{
urlPattern: /^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,
handler: "CacheFirst",
options: {
cacheName: "google-fonts-webf... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/next-pwa/register.js | packages/next-pwa/register.js | import { Workbox } from "workbox-window";
if (
typeof window !== "undefined" &&
"serviceWorker" in navigator &&
typeof caches !== "undefined"
) {
if (__PWA_START_URL__) {
caches.has("start-url").then(function (has) {
if (!has) {
caches
.open("start-url")
.then((c) =>
... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/next-pwa/build-custom-worker.js | packages/next-pwa/build-custom-worker.js | "use strict";
const path = require("path");
const fs = require("fs");
const webpack = require("webpack");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const buildCustomWorker = ({
id,
basedir,
customWorkerDir,
destdir,
plugins,
mini... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/next-pwa/fallback.js | packages/next-pwa/fallback.js | "use strict";
self.fallback = async (request) => {
// https://developer.mozilla.org/en-US/docs/Web/API/RequestDestination
switch (request.destination) {
case "document":
if (process.env.__PWA_FALLBACK_DOCUMENT__)
return caches.match(process.env.__PWA_FALLBACK_DOCUMENT__, {
ignoreSearch:... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/next-pwa/build-fallback-worker.js | packages/next-pwa/build-fallback-worker.js | "use strict";
const path = require("path");
const fs = require("fs");
const webpack = require("webpack");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const getFallbackEnvs = ({ fallbacks, basedir, id, pageExtensions }) => {
let { document, d... | javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/config-prettier/index.js | packages/config-prettier/index.js | module.exports = {
trailingComma: "es5",
tabWidth: 2,
semi: true,
singleQuote: false,
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
ImBIOS/next-pwa | https://github.com/ImBIOS/next-pwa/blob/3c007b3699a29678a197ee5447b58daedcf9b72e/packages/eslint-config-custom/index.js | packages/eslint-config-custom/index.js | module.exports = {
extends: ["next/core-web-vitals", "turbo", "prettier"],
parserOptions: {
babelOptions: {
presets: [require.resolve("next/babel")],
},
},
};
| javascript | MIT | 3c007b3699a29678a197ee5447b58daedcf9b72e | 2026-01-05T03:45:24.497996Z | false |
RadhiFadlillah/duit | https://github.com/RadhiFadlillah/duit/blob/fbe59030f7cd675d999a6788f7eda5c08867b50b/internal/view/js/login.min.js | internal/view/js/login.min.js | import{Button,LoadingCover}from"./components/_components.min.js";import{request}from"./libs/utils.min.js";import{i18n}from"./i18n/i18n.min.js";import Cookies from"./libs/js-cookie.min.js";function loginScreen(){let o={loading:!1,username:"",password:"",error:""};return{view:function(){let e=[];""!==o.error&&e.push(m("p... | javascript | MIT | fbe59030f7cd675d999a6788f7eda5c08867b50b | 2026-01-05T03:44:59.757299Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.