Skip to content

Commit

Permalink
Drop support for Node < v12.17
Browse files Browse the repository at this point in the history
Upgrade deps, dates, CI.. Now ES6 module
  • Loading branch information
75lb committed Jul 25, 2024
1 parent f74bee2 commit 9b66e3e
Show file tree
Hide file tree
Showing 8 changed files with 1,265 additions and 676 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [12, 14, 16, 18, 20, 22]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-20 Lloyd Brookes <[email protected]>
Copyright (c) 2016-24 Lloyd Brookes <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![view on npm](https://img.shields.io/npm/v/lws-conditional-get.svg)](https://www.npmjs.org/package/lws-conditional-get)
[![npm module downloads](https://img.shields.io/npm/dt/lws-conditional-get.svg)](https://www.npmjs.org/package/lws-conditional-get)
[![Build Status](https://travis-ci.org/lwsjs/conditional-get.svg?branch=master)](https://travis-ci.org/lwsjs/conditional-get)
[![Dependency Status](https://badgen.net/david/dep/lwsjs/conditional-get)](https://david-dm.org/lwsjs/conditional-get)
[![view on npm](https://badgen.net/npm/v/lws-conditional-get)](https://www.npmjs.org/package/lws-conditional-get)
[![npm module downloads](https://badgen.net/npm/dt/lws-conditional-get)](https://www.npmjs.org/package/lws-conditional-get)
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/lwsjs/conditional-get)](https://github.com/lwsjs/conditional-get/network/dependents?dependent_type=REPOSITORY)
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/lwsjs/conditional-get)](https://github.com/lwsjs/conditional-get/network/dependents?dependent_type=PACKAGE)
[![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)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)

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

* * *

&copy; 2017-20 Lloyd Brookes <[email protected]>.
&copy; 2017-24 Lloyd Brookes <[email protected]>.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const EventEmitter = require('events')
import EventEmitter from 'events'
import koaConditionalGet from 'koa-conditional-get'
import koaETag from 'koa-etag'

class ConditionalGet extends EventEmitter {
description () {
Expand All @@ -20,11 +22,11 @@ class ConditionalGet extends EventEmitter {
this.emit('verbose','middleware.conditional-get.config', mwOptions)
if (!mwOptions.noConditionalGet) {
return [
require('koa-conditional-get')(),
require('koa-etag')()
koaConditionalGet(),
koaETag()
]
}
}
}

module.exports = ConditionalGet
export default ConditionalGet
Loading

0 comments on commit 9b66e3e

Please sign in to comment.