Skip to content

Commit

Permalink
Merge pull request #8 from LinusU/modernize
Browse files Browse the repository at this point in the history
💥 Drop support for Node.js < 6.x
  • Loading branch information
LinusU authored Jun 12, 2018
2 parents dc85805 + 447cc45 commit bd488d7
Show file tree
Hide file tree
Showing 9 changed files with 1,012 additions and 814 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/node_modules/
/npm-debug.log
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- '0.10'
- '0.12'
- '4'
- '5'
- '6'
- '8'
- '10'
18 changes: 0 additions & 18 deletions README.md

This file was deleted.

14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var os = require('os')
var path = require('path')
var homedir = require('os-homedir')
const os = require('os')
const path = require('path')
const homedir = require('os-homedir')

function posix (id) {
var cacheHome = process.env.XDG_CACHE_HOME || path.join(homedir(), '.cache')
const cacheHome = process.env.XDG_CACHE_HOME || path.join(homedir(), '.cache')
return path.join(cacheHome, id)
}

Expand All @@ -12,11 +12,11 @@ function darwin (id) {
}

function win32 (id) {
var appData = process.env.LOCALAPPDATA || path.join(homedir(), 'AppData', 'Local')
const appData = process.env.LOCALAPPDATA || path.join(homedir(), 'AppData', 'Local')
return path.join(appData, id, 'Cache')
}

var implementation = (function () {
const implementation = (function () {
switch (os.platform()) {
case 'android': return posix
case 'darwin': return darwin
Expand All @@ -27,7 +27,7 @@ var implementation = (function () {
}
}())

module.exports = function (id) {
module.exports = function cachedir (id) {
if (typeof id !== 'string') {
throw new TypeError('id is not a string')
}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE → license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013 Linus Unnebäck
Copyright (c) 2013-2014, 2016, 2018 Linus Unnebäck

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

0 comments on commit bd488d7

Please sign in to comment.