Comparing version 3.2.0 to 4.0.0
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const path = __importStar(require("path")); | ||
const fs = __importStar(require("fs")); | ||
const ical2json_1 = require("./ical2json"); | ||
const utils_1 = require("./utils"); | ||
const cwd = process.cwd(); | ||
/** | ||
* Pass in options to parse and generate JSON files | ||
* @param {Object} options | ||
* @return {Promise} | ||
*/ | ||
function default_1(options) { | ||
const files = options.args || []; | ||
function default_1(files = [], options) { | ||
let outputDir = ''; | ||
if (options.outputDir) { | ||
outputDir = path.resolve(cwd, (0, utils_1.untildify)(options.outputDir)); | ||
const outputDirStat = fs.statSync(outputDir, { throwIfNoEntry: false }); | ||
if (!outputDirStat || !outputDirStat.isDirectory()) { | ||
console.error(`ical2json: ${outputDir}: Invalid directory`); | ||
return false; | ||
} | ||
} | ||
for (let i = 0; i < files.length; i++) { | ||
@@ -40,3 +67,3 @@ const file = files[i]; | ||
const basename = path.basename(filePath, ext); | ||
const dirname = path.dirname(filePath); | ||
const dirname = outputDir || path.dirname(filePath); | ||
const compiledExt = isConvert ? '.json' : '.ics'; | ||
@@ -43,0 +70,0 @@ const writePath = path.join(dirname, basename) + compiledExt; |
{ | ||
"name": "ical2json", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "A simple node package to convert ical to JSON", | ||
@@ -35,3 +35,3 @@ "main": "build/ical2json.js", | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -42,18 +42,18 @@ "author": "Adrian Lee", | ||
"devDependencies": { | ||
"@types/node": "^20.9.0", | ||
"@types/node": "^20.14.2", | ||
"@typescript-eslint/eslint-plugin": "^6.10.0", | ||
"@typescript-eslint/parser": "^6.10.0", | ||
"ava": "^5.3.1", | ||
"ava": "^6.1.3", | ||
"eslint": "^8.53.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"execa": "^5.1.1", | ||
"nyc": "^15.1.0", | ||
"prettier": "^3.1.0", | ||
"tempy": "^1.0.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.2.2" | ||
"execa": "^9.2.0", | ||
"nyc": "^17.0.0", | ||
"prettier": "^3.3.2", | ||
"tempy": "^3.1.0", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"dependencies": { | ||
"commander": "^11.1.0" | ||
"commander": "^12.1.0" | ||
}, | ||
@@ -67,3 +67,8 @@ "ava": { | ||
] | ||
}, | ||
"nyc": { | ||
"include": [ | ||
"src" | ||
] | ||
} | ||
} |
@@ -6,3 +6,3 @@ # ical2json | ||
![Tests](https://github.com/adrianlee44/ical2json/workflows/Tests/badge.svg) | ||
[![Coveralls branch](https://img.shields.io/coveralls/adrianlee44/ical2json/master.svg?style=flat-square)](https://coveralls.io/github/adrianlee44/ical2json?branch=master) | ||
[![codecov](https://codecov.io/gh/adrianlee44/ical2json/graph/badge.svg?token=SIFGIFEB7T)](https://codecov.io/gh/adrianlee44/ical2json) | ||
@@ -19,5 +19,5 @@ ## Getting started | ||
```sh | ||
$ ical2json ./US-Holiday.ics | ||
``` | ||
ical2json ./US-Holiday.ics | ||
``` | ||
@@ -30,2 +30,8 @@ The json output will be written to a `.json` file in the same directory | ||
To write the output to a separate directory, use the `-o` or `--output-dir` option | ||
```sh | ||
$ ical2json --output-dir ~/destination/directory ./US-Holiday.ics | ||
``` | ||
File output: | ||
@@ -98,6 +104,6 @@ | ||
Options: | ||
-h, --help output usage information | ||
-r, --revert Revert JSON to ical | ||
-V, --version output the version number | ||
-V, --version output the version number | ||
-r, --revert Revert JSON to ical | ||
-o, --output-dir <path> Output directory | ||
-h, --help display help for command | ||
``` | ||
@@ -104,0 +110,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12979
185
118
+ Addedcommander@12.1.0(transitive)
- Removedcommander@11.1.0(transitive)
Updatedcommander@^12.1.0