New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

idn-area-extractor

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idn-area-extractor - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

lib/chunk-BNGMSJYP.js

6

lib/cli.js
#!/usr/bin/env node
import{a as r,b as o,c as l}from"./chunk-AWZUUL7L.js";import{confirm as n,input as s,select as c}from"@inquirer/prompts";import{existsSync as f,lstatSync as g}from"fs";import p from"meow";var d=p(`
import{a as r,b as o,c as l}from"./chunk-BNGMSJYP.js";import{confirm as n,input as s,select as c}from"@inquirer/prompts";import{existsSync as f,lstatSync as g}from"fs";import p from"meow";var d=p(`
USAGE

@@ -8,3 +8,3 @@ $ idnxtr [regencies|districts|islands|villages] </path/to/file.[pdf|txt]> [OPTIONS]

-c, --compare Compare the extracted data with the latest data
-d, --destination=<path> Set the folder destination
-d, --destination=<path> Set the folder destination. Default: current working directory
-o, --output=<filename> Set a specific output file name without the file extension

@@ -21,4 +21,4 @@ -r, --range=<range> Extract specific PDF pages (e.g. 1-2,5,7-10)

$ idnxtr regencies ~/data/raw-regencies.txt
`,{importMeta:import.meta,description:"Extract Indonesia area data from PDF",booleanDefault:void 0,flags:{compare:{shortFlag:"c",type:"boolean"},destination:{shortFlag:"d",type:"string"},output:{shortFlag:"o",type:"string"},range:{shortFlag:"r",type:"string"},saveRaw:{shortFlag:"R",type:"boolean"},silent:{type:"boolean"}}});async function m(){let[t,i]=d.input,{flags:e}=d;!t&&!i&&!Object.keys(e).length&&(t=await c({message:"Which kind of data to extract?",choices:r.map(a=>({value:a}))}),i=await s({message:"Enter the file path:",validate(a){return a.trim()?!f(a)||!g(a).isFile()?"The file path does not exists":!0:"The file path cannot be empty"}}),await o(i)&&(e.range=await s({message:"Set specific pages range to extract? (e.g. 1-2,5,7-10)"}),e.range===""&&(e.range=void 0),e.saveRaw=await n({message:"Save the extracted raw data?",default:!1})),e.destination=await s({message:"Enter the destination folder:",default:process.cwd()}),e.output=await s({message:"What the output file name would you like to use?",default:t}),e.compare=await n({message:"Compare for data changes?",default:!1}),e.silent=await n({message:"Disable all logs?",default:!1})),await l({data:t,filePath:i,...e}),e.silent||console.log(`
`,{importMeta:import.meta,description:"Extract Indonesia area data from PDF",booleanDefault:void 0,flags:{compare:{shortFlag:"c",type:"boolean"},destination:{shortFlag:"d",type:"string"},output:{shortFlag:"o",type:"string"},range:{shortFlag:"r",type:"string"},saveRaw:{shortFlag:"R",type:"boolean"},silent:{type:"boolean"}}});async function m(){let[t,i]=d.input,{flags:e}=d;!t&&!i&&!Object.keys(e).length&&(t=await c({message:"Which kind of data to extract?",choices:r.map(a=>({value:a}))}),i=await s({message:"Enter the file path:",validate(a){return a.trim()?!f(a)||!g(a).isFile()?"The file path does not exists":!0:"The file path cannot be empty"}}),await o(i)&&(e.range=await s({message:"Set specific pages range to extract? (e.g. 1-2,5,7-10)"}),e.range===""&&(e.range=void 0),e.saveRaw=await n({message:"Save the extracted raw data?",default:!1})),e.destination=await s({message:"Set specific destination folder?"}),e.output=await s({message:"What the output file name would you like to use?",default:t}),e.compare=await n({message:"Compare for data changes?",default:!1}),e.silent=await n({message:"Disable all logs?",default:!1})),await l({data:t,filePath:i,...e}),e.silent||console.log(`
Done!`)}m().catch(t=>{console.error(`${t.name}: ${t.message}`),process.exit(1)});
//# sourceMappingURL=cli.js.map
type DataEntity = 'regencies' | 'districts' | 'islands' | 'villages';
declare const dataEntities: readonly DataEntity[];
declare function isFilePdf(path: string): Promise<boolean>;
declare function isFilePdf(fpath: string): Promise<boolean>;
interface ExtractorOptions {

@@ -16,6 +16,3 @@ /**

*
* @default
* ```js
* process.cwd()
* ```
* The default is the current working directory.
*/

@@ -50,2 +47,2 @@ destination?: string;

export { DataEntity, ExtractorOptions, dataEntities, idnxtr as default, isFilePdf };
export { type DataEntity, type ExtractorOptions, dataEntities, idnxtr as default, isFilePdf };

@@ -1,2 +0,2 @@

import{a,b,c}from"./chunk-AWZUUL7L.js";export{a as dataEntities,c as default,b as isFilePdf};
import{a,b,c}from"./chunk-BNGMSJYP.js";export{a as dataEntities,c as default,b as isFilePdf};
//# sourceMappingURL=index.js.map
{
"name": "idn-area-extractor",
"version": "0.4.0",
"version": "0.5.0",
"description": "Extract Indonesia area data from the raw sources to CSV",

@@ -45,19 +45,19 @@ "type": "module",

"devDependencies": {
"@types/node": "^20.5.9",
"@types/papaparse": "^5.3.8",
"@types/node": "^20.10.0",
"@types/papaparse": "^5.3.13",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vitest/coverage-v8": "^0.34.3",
"eslint": "^8.47.0",
"@vitest/coverage-v8": "^0.34.6",
"eslint": "^8.54.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.3"
"tsup": "^8.0.1",
"typescript": "^5.3.2",
"vitest": "^0.34.6"
},
"dependencies": {
"@inquirer/prompts": "^3.0.4",
"file-type": "^18.5.0",
"idn-area-data": "^3.0.0",
"file-type": "^18.7.0",
"idn-area-data": "^3.0.1",
"jest-diff": "^29.6.4",

@@ -68,4 +68,5 @@ "meow": "^12.1.1",

"papaparse": "^5.4.1",
"pdfjs-dist": "^3.9.179"
"pdfjs-dist": "^4.0.269",
"super-regex": "^0.3.0"
}
}

@@ -7,20 +7,2 @@ <h1>idn-area-extractor</h1>

<h2>Table of Contents</h2>
- [Prerequisite](#prerequisite)
- [Installation](#installation)
- [Usage](#usage)
- [Interactive UI](#interactive-ui)
- [API](#api)
- [`idnxtr(options)`](#idnxtroptions)
- [`options`](#options)
- [Example](#example)
- [ESM](#esm)
- [CommonJS](#commonjs)
- [Problem Reporting](#problem-reporting)
- [Reporting a Bug](#reporting-a-bug)
- [Requesting a New Feature](#requesting-a-new-feature)
- [Asking a Question](#asking-a-question)
- [Support This Project](#support-this-project)
## Prerequisite

@@ -57,3 +39,3 @@

-c, --compare Compare the extracted data with the latest data
-d, --destination=<path> Set the folder destination
-d, --destination=<path> Set the folder destination. Default: current working directory
-o, --output=<filename> Set a specific output file name without the file extension

@@ -157,4 +139,4 @@ -r, --range=<range> Extract specific PDF pages (e.g. 1-2,5,7-10)

<a href="https://trakteer.id/fityannugroho/tip" target="_blank"><img id="wse-buttons-preview" src="https://cdn.trakteer.id/images/embed/trbtn-red-6.png" style="border: 0px none; height: 36px; --darkreader-inline-border-top: currentcolor; --darkreader-inline-border-right: currentcolor; --darkreader-inline-border-bottom: currentcolor; --darkreader-inline-border-left: currentcolor;" alt="Trakteer Saya" data-darkreader-inline-border-top="" data-darkreader-inline-border-right="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" height="40"></a>
Give a ⭐️ if this project helped you!
You can support this project by donating via [GitHub Sponsor](https://github.com/sponsors/fityannugroho), [Trakteer](https://trakteer.id/fityannugroho/tip), or [Saweria](https://saweria.co/fityannugroho).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc