Skip to content

Commit 9b66e3e

Browse files
committed
Drop support for Node < v12.17
Upgrade deps, dates, CI.. Now ES6 module
1 parent f74bee2 commit 9b66e3e

File tree

8 files changed

+1265
-676
lines changed

8 files changed

+1265
-676
lines changed

.github/workflows/node.js.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
2+
3+
name: Node.js CI
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest]
19+
node-version: [12, 14, 16, 18, 20, 22]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: 'npm'
28+
- run: npm install
29+
- run: npm test

.travis.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-20 Lloyd Brookes <75pound@gmail.com>
3+
Copyright (c) 2016-24 Lloyd Brookes <75pound@gmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
[![view on npm](https://img.shields.io/npm/v/lws-conditional-get.svg)](https://www.npmjs.org/package/lws-conditional-get)
2-
[![npm module downloads](https://img.shields.io/npm/dt/lws-conditional-get.svg)](https://www.npmjs.org/package/lws-conditional-get)
3-
[![Build Status](https://travis-ci.org/lwsjs/conditional-get.svg?branch=master)](https://travis-ci.org/lwsjs/conditional-get)
4-
[![Dependency Status](https://badgen.net/david/dep/lwsjs/conditional-get)](https://david-dm.org/lwsjs/conditional-get)
1+
[![view on npm](https://badgen.net/npm/v/lws-conditional-get)](https://www.npmjs.org/package/lws-conditional-get)
2+
[![npm module downloads](https://badgen.net/npm/dt/lws-conditional-get)](https://www.npmjs.org/package/lws-conditional-get)
3+
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/lwsjs/conditional-get)](https://github.com/lwsjs/conditional-get/network/dependents?dependent_type=REPOSITORY)
4+
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/lwsjs/conditional-get)](https://github.com/lwsjs/conditional-get/network/dependents?dependent_type=PACKAGE)
5+
[![Node.js CI](https://github.com/lwsjs/conditional-get/actions/workflows/node.js.yml/badge.svg)](https://github.com/lwsjs/conditional-get/actions/workflows/node.js.yml)
56
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
67

78
# lws-conditional-get
@@ -17,4 +18,4 @@ Adds the following options to lws.
1718

1819
* * *
1920

20-
&copy; 2017-20 Lloyd Brookes <75pound@gmail.com>.
21+
&copy; 2017-24 Lloyd Brookes <75pound@gmail.com>.

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const EventEmitter = require('events')
1+
import EventEmitter from 'events'
2+
import koaConditionalGet from 'koa-conditional-get'
3+
import koaETag from 'koa-etag'
24

35
class ConditionalGet extends EventEmitter {
46
description () {
@@ -20,11 +22,11 @@ class ConditionalGet extends EventEmitter {
2022
this.emit('verbose','middleware.conditional-get.config', mwOptions)
2123
if (!mwOptions.noConditionalGet) {
2224
return [
23-
require('koa-conditional-get')(),
24-
require('koa-etag')()
25+
koaConditionalGet(),
26+
koaETag()
2527
]
2628
}
2729
}
2830
}
2931

30-
module.exports = ConditionalGet
32+
export default ConditionalGet

0 commit comments

Comments
 (0)