Repository: btargac/excel-parser-processor
Branch: master
Commit: a0ec2a40f066
Files: 32
Total size: 54.2 KB
Directory structure:
gitextract_yw4frl62/
├── .babelrc
├── .browserslistrc
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── codeql-analysis.yml
│ └── main.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── build/
│ └── icons/
│ └── mac/
│ └── icon.icns
├── icon.sketch
├── package.json
├── src/
│ ├── dialogs.js
│ ├── index.html
│ ├── index.js
│ ├── preload.js
│ ├── renderer.js
│ ├── styles/
│ │ ├── index.scss
│ │ ├── progress-bar.scss
│ │ └── toasts.scss
│ └── utils/
│ ├── generateFileName.js
│ ├── generateFileName.spec.js
│ ├── processItems.js
│ └── processItems.spec.js
├── webpack.dev.js
├── webpack.main.js
├── webpack.prod.js
└── webpack.renderer.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": {
"version": "3.25" }
}
]
],
"plugins": [
["@babel/plugin-transform-runtime",
{ "corejs": 3,
"version": "^7.18.10"
}
]
]
}
================================================
FILE: .browserslistrc
================================================
electron >= 19
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [btargac]
open_collective: excel-parser-processor
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
# Check the npm registry for updates every day (weekdays) at 10am GMT+3
schedule:
interval: "daily"
time: "10:00"
timezone: "Europe/Istanbul"
assignees:
- "btargac"
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '40 2 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
================================================
FILE: .github/workflows/main.yml
================================================
name: Build & release
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-release:
name: Build and release the Electron App
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Build
run: |
npm install
npm run build
npm run test
- name: Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Distribute Mac OS X and Windows binaries
if: ${{ matrix.os == 'macos-latest' }}
run: |
npm run dist -- --mac --win
- name: Distribute Linux binaries
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
npm run dist
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
release/
dist/
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.idea/
# os specific temp files
.DS_Store
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at btargac@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to excel-parser-processor
We would love for you to contribute to excel-parser-processor and help make it even better than it is
today! As a contributor, here are the guidelines we would like you to follow:
- [Code of Conduct](#coc)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
## <a name="coc"></a> Code of Conduct
Help us keep excel-parser-processor open and inclusive. Please read and follow our [Code of Conduct][coc].
## <a name="question"></a> Got a Question or Problem?
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests.
You've got much better chances of getting your question answered in real-time, you can reach out via [our gitter channel][gitter].
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to gitter channel.
## <a name="issue"></a> Found a Bug?
If you find a bug in the source code, you can help us by
[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can
[submit a Pull Request](#submit-pr) with a fix.
## <a name="feature"></a> Missing a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
Repository. If you would like to *implement* a new feature, please submit an issue with
a for your work first, to be sure that we can use it.
Please consider what kind of change it is:
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
and help you to craft the change so that it is successfully accepted into the project.
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
## <a name="submit"></a> Submission Guidelines
### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario by attaching the excel file that caused an error, or the updated source code that caused
the error. A reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like:
- version of excel-parser-processor used
- 3rd-party libraries and their versions
- and most importantly - a use-case that fails
We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced.
You can file new issues by filling out our [new issue form](https://github.com/btargac/excel-parser-processor/issues/new).
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines:
* Search [GitHub](https://github.com/btargac/excel-parser-processor/pulls) for an open or closed PR
that relates to your submission. You don't want to duplicate effort.
* Make your changes in a new git branch:
```shell
git checkout -b my-fix-branch master
```
* Create your patch, **including appropriate test cases**.
* Follow our [Coding Rules](#rules).
* Run the full excel-parser-processor test suite, and ensure that all tests pass.
* Commit your changes using a descriptive commit message that follows our
[commit message conventions](#commit). Adherence to these conventions
is necessary because release notes are automatically generated from these messages.
```shell
git commit -a
```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
* Push your branch to GitHub:
```shell
git push origin my-fix-branch
```
* In GitHub, send a pull request to `excel-parser-processor:master`.
* If we suggest changes then:
* Make the required updates.
* Re-run the excel-parser-processor test suites to ensure tests are still passing.
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
```shell
git rebase master -i
git push -f
```
That's it! Thank you for your contribution!
#### After your pull request is merged
After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
```shell
git push origin --delete my-fix-branch
```
* Check out the master branch:
```shell
git checkout master -f
```
* Delete the local branch:
```shell
git branch -D my-fix-branch
```
* Update your master with the latest upstream version:
```shell
git pull --ff upstream master
```
## <a name="rules"></a> Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
* All public API methods **must be documented**.
## <a name="commit"></a> Commit Message Guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the excel-parser-processor change log**.
### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The **header** is mandatory and the **scope** of the header is optional.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.
Footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
Samples: (even more [samples](https://github.com/btargac/excel-parser-processor/commits/master))
```
docs(changelog): update change log to beta.5
```
```
fix(release): need to depend on latest electron
The version in our package.json gets copied to the one we publish, and users need the latest of these.
```
### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
### Type
Must be one of the following:
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix
* **perf**: A code change that improves performance
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **test**: Adding missing tests or correcting existing tests
### Scope
The scope should be the name of the module affected (folder name or other meaningful words), and should prefix with *module:* (as perceived by person reading changelog generated from commit messages.
The following are some examples:
* **module:http**
* **module:xlsx**
* **module:OTHER_COMPONENT_NAME**
There are currently a few exceptions to the "use module name" rule:
* **packaging**: used for changes that change the npm package layout, e.g. public path changes, package.json changes, d.ts file/format changes, changes to bundles, etc.
* **changelog**: used for updating the release notes in CHANGELOG.md
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)
### Subject
The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
A detailed explanation can be found in this [document][commit-message-format].
[coc]: https://github.com/btargac/excel-parser-processor/blob/master/CODE_OF_CONDUCT.md
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
[github]: https://github.com/btargac/excel-parser-processor
[gitter]: https://gitter.im/excel-parser-processor/
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Burak Targaç
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 the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# <img src="build/icons/128x128.png" width="64px" align="center" alt="Excel Parser Processor"> Excel Parser Processor
### A Desktop app for processing all rows of Excel files
Simply generates an array of items from the rows of an Excel file and does the repetitive tedious operations step by
step till every item of the array is processed. For example downloads all the assets from the URLs from column A in an
Excel file.
[![Dependency Status][dependabot-badge]][dependabot-url]
[![Build Status][gh-actions-image]][gh-actions-url]
[![Github Tag][github-tag-image]][github-tag-url]
[![codecov][codecov-image]][codecov-url]
[](#backers)
[](#sponsors)
[](https://www.codetriage.com/btargac/excel-parser-processor)
[![CodeFactor][CodeFactor-image]][CodeFactor-url]
[![CodeQL][codeql-image]][codeql-url]
#### How to use
You can [download the latest release](https://github.com/btargac/excel-parser-processor/releases) for your operating system
or build it yourself (see [Development](#development)).
Just select or drag & drop an Excel file, then select the output folder for the downloaded images or files. All the items
in the Excel file will be downloaded into the selected folder, and you will be notified about the state of ongoing progress.
#### Sample Excel file structure
| | A (resource to download) | B (new filename if used) | C (subfolder name) |
|---|:----------------------------------------------------|:--------------------------|:-------------------------|
| 1 | https://www.buraktargac.com/sample_image.gif | optional-sample-file-name | optional-sub-folder-name |
| 2 | https://www.buraktargac.com/sample_image.png | optional-sample-file-name | optional-sub-folder-name |
| 3 | https://www.buraktargac.com/sample_image.jpg | | |
| . | ... | | |
| . | ... | | |
| n | Asset URL (any type of file image, text, pdf etc.) | | |
<br/>
Currently, there is no limit for `n`, I tested with 4000 items and unless your IP is banned from the publisher there
is no problem to download as much as you can.
#### Demo
<img src="excel-parser-processor.gif" width="640px" height="480px" align="center" alt="Excel Parser Processor Demo">
#### Development
You need to have [Node.js](https://nodejs.org) installed on your computer in order to develop & build this app.
```bash
$ git clone https://github.com/btargac/excel-parser-processor.git
$ cd excel-parser-processor
$ npm install
$ npm run build
$ npm start
```
If you are changing the view or renderer related things, you can use Webpack's watch feature with
```bash
$ npm run start-renderer-dev
```
After running this command, you'll see a webpack process watching your files after a new renderer.bundle.js is generated
you can refresh the Excel parser processor app window with `cmd + R` or `ctrl + R` depending on your system.
To generate binaries on your computer after your development is completed, you can run;
```bash
$ npm run dist
```
This will add binaries under `/release` folder on your project folder.
`/release` folder is ignored at the repository. Github Actions will be building the binaries after your branch is merged with master.
## Contributors
This project exists thanks to all the people who contribute. [[Code of Conduct](CODE_OF_CONDUCT.md)].
<a href="graphs/contributors"><img src="https://opencollective.com/excel-parser-processor/contributors.svg?width=890&button=false" /></a>
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/excel-parser-processor#backer)]
<a href="https://opencollective.com/excel-parser-processor#backers" target="_blank"><img src="https://opencollective.com/excel-parser-processor/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/excel-parser-processor#sponsor)]
<a href="https://opencollective.com/excel-parser-processor/sponsor/0/website" target="_blank"><img src="https://opencollective.com/excel-parser-processor/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/excel-parser-processor/sponsor/1/website" target="_blank"><img src="https://opencollective.com/excel-parser-processor/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/excel-parser-processor/sponsor/2/website" target="_blank"><img src="https://opencollective.com/excel-parser-processor/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/excel-parser-processor/sponsor/3/website" target="_blank"><img src="https://opencollective.com/excel-parser-processor/sponsor/3/avatar.svg"></a>
#### License
MIT © [Burak Targaç](https://github.com/btargac)
[dependabot-badge]: https://badgen.net/github/dependabot/btargac/excel-parser-processor?icon=dependabot
[dependabot-url]: https://github.com/btargac/excel-parser-processor/security/dependabot
[gh-actions-image]: https://github.com/btargac/excel-parser-processor/actions/workflows/main.yml/badge.svg?branch=master
[gh-actions-url]: https://github.com/btargac/excel-parser-processor/actions/workflows/main.yml
[github-tag-image]: https://img.shields.io/github/tag/btargac/excel-parser-processor.svg
[github-tag-url]: https://github.com/btargac/excel-parser-processor/releases/latest
[codecov-image]: https://codecov.io/gh/btargac/excel-parser-processor/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/btargac/excel-parser-processor
[CodeFactor-image]: https://www.codefactor.io/repository/github/btargac/excel-parser-processor/badge
[CodeFactor-url]: https://www.codefactor.io/repository/github/btargac/excel-parser-processor
[codeql-image]: https://github.com/btargac/excel-parser-processor/actions/workflows/codeql-analysis.yml/badge.svg?branch=master
[codeql-url]: https://github.com/btargac/excel-parser-processor/actions/workflows/codeql-analysis.yml
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| > 1.1 | :white_check_mark: |
| < 1.1 | :x: |
## Reporting a Vulnerability
Just open a new issue with the possible vulnerability that you found. Please add a list if it's related to a npm package.
Check if it's already listed or there's an ongoing fix progress for that.
[Code scanning reports](https://github.com/btargac/excel-parser-processor/security/code-scanning)
[Dependabot alerts](https://github.com/btargac/excel-parser-processor/security/dependabot)
================================================
FILE: package.json
================================================
{
"name": "excel-parser-processor",
"productName": "Excel Parser Processor",
"version": "1.4.1",
"description": "Does the tedious processing over all items of a given excel file by converting the rows to an array and processing them all",
"main": "./dist/index.bundle.js",
"scripts": {
"build-main": "cross-env NODE_ENV=production PROCESS_TYPE=main webpack --config webpack.prod.js",
"build-main-dev": "cross-env NODE_ENV=development PROCESS_TYPE=main webpack --config webpack.dev.js",
"build-renderer": "cross-env NODE_ENV=production PROCESS_TYPE=renderer webpack --config webpack.prod.js",
"build": "npm-run-all build-main build-renderer",
"build-dev": "npm-run-all -p build-main-dev start-renderer-dev",
"generate-icons": "electron-icon-maker --input=./build-assets/icon.png --output=./build/",
"start-renderer-dev": "cross-env NODE_ENV=development PROCESS_TYPE=renderer webpack serve --config webpack.dev.js",
"start": "cross-env NODE_ENV=development electron --inspect ./dist/index.bundle.js",
"test": "jest",
"test-watch": "jest --coverage --watch",
"pack": "electron-builder build --dir",
"dist": "electron-builder build"
},
"jest": {
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"transform": {
"^.+\\.jsx?$": "babel-jest"
},
"testPathIgnorePatterns": [
"<rootDir>/dist/",
"<rootDir>/node_modules/"
]
},
"repository": {
"type": "git",
"url": "https://github.com/btargac/excel-parser-processor.git"
},
"keywords": [
"electron",
"process",
"excel",
"download",
"parse",
"read excel",
"process excel file"
],
"author": {
"name": "Burak Targaç",
"email": "btargac@gmail.com",
"url": "https://www.buraktargac.com"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/btargac/excel-parser-processor/issues"
},
"homepage": "https://github.com/btargac/excel-parser-processor#readme",
"devDependencies": {
"@babel/core": "^7.27.4",
"@babel/plugin-transform-runtime": "^7.27.4",
"@babel/preset-env": "^7.28.3",
"babel-jest": "^29.6.1",
"babel-loader": "^10.0.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^13.0.0",
"core-js": "^3.42.0",
"cross-env": "^7.0.3",
"css-loader": "^7.1.2",
"electron": "^36.8.1",
"electron-builder": "^26.0.12",
"electron-icon-maker": "^0.0.5",
"html-webpack-exclude-assets-plugin": "^0.0.7",
"html-webpack-plugin": "^5.6.3",
"jest": "^30.3.0",
"mini-css-extract-plugin": "^2.9.2",
"npm-run-all": "^4.1.5",
"sass-loader": "^16.0.5",
"style-loader": "^4.0.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^5.99.9",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.2"
},
"dependencies": {
"@babel/runtime-corejs3": "^7.28.4",
"@fortawesome/fontawesome": "^1.1.8",
"@fortawesome/fontawesome-free-solid": "^5.0.13",
"electron-fetch": "^1.9.1",
"is-url": "^1.2.4",
"jquery": "^3.6.4",
"mime-types": "^3.0.1",
"normalize.css": "^8.0.1",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.2/xlsx-0.19.2.tgz"
},
"build": {
"appId": "com.Targac.ExcelParserProcessor",
"productName": "Excel Parser Processor",
"copyright": "Copyright © 2018 Burak Targaç",
"compression": "maximum",
"files": [
"!build-assets${/*}",
"!coverage${/*}",
"!src${/*}"
],
"directories": {
"output": "release"
},
"win": {
"target": [
{
"target": "nsis-web",
"arch": [
"x64",
"ia32"
]
}
]
}
},
"publish": {
"provider": "github",
"owner": "Burak Targaç"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/excel-parser-processor"
}
}
================================================
FILE: src/dialogs.js
================================================
import { dialog } from 'electron';
export const showOpenDialog = async (browserWindow, data, cb) => {
try {
const { canceled, filePaths } = await dialog.showOpenDialog(browserWindow, {
buttonLabel: "Choose",
defaultPath: data.path,
title: "Choose an output folder",
properties: ['openDirectory', 'createDirectory']
});
if( !canceled && filePaths?.length) {
cb(data.file, filePaths[0], browserWindow);
}
} catch (err) {
console.log(err);
}
};
================================================
FILE: src/index.html
================================================
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div class="app">
<div class="app__header">
<div class="app__header__logo">
<img src="images/header-logo.png" width="64" height="64" alt="Excel Processor">
</div>
<h1 class="app__title">
Excel processor
</h1>
<p class="app__description">
Select the Excel file, and the output folder, Excel Processor will handle the rest.
</p>
</div>
</div>
<div class="wrapper">
<div class="drop">
<div class="cont">
<i class="fas fa-cloud-upload-alt fa-5x"></i>
<div class="tit">
Drag & Drop
</div>
<div class="desc">
your Excel files, or
</div>
<div class="browse">
click to browse
</div>
</div>
<input id="files" name="files" type="file" />
</div>
</div>
<div class="progress">
<b class="progress__bar">
<span class="progress__text">
Progress: <em>0%</em>
</span>
</b>
</div>
<div class="error-toast">
<i class="fas fa-exclamation-circle fa-4x"></i>
<span class="text"></span>
</div>
<div class="notification-toast">
<i class="fas fa-check-circle fa-4x"></i>
<span class="text"></span>
</div>
</body>
</html>
================================================
FILE: src/index.js
================================================
import path from 'path';
import { app, BrowserWindow, ipcMain } from 'electron';
import { showOpenDialog } from './dialogs';
import { processFile } from "./utils/processItems";
const isDevMode = process.env.NODE_ENV === 'development';
const createWindow = () => {
// Create the browser window.
const win = new BrowserWindow({
width: 800,
height: 600,
show: false,
webPreferences: {
contextIsolation: true,
devTools: isDevMode,
enableRemoteModule: false,
nodeIntegration: false,
preload: path.join(__dirname, 'preload.js')
}
});
// and load the index.html of the app.
if (isDevMode) {
win.loadURL('http://localhost:8080',{})
} else {
win.loadFile(path.join(__dirname, 'index.html'));
}
win.once('ready-to-show', () => {
win.show();
});
// Open the DevTools during development.
if(isDevMode) {
win.webContents.openDevTools();
}
};
app.on('ready', () => {
ipcMain.on('file-dropped', (event, data) => {
const [window] = BrowserWindow.getAllWindows();
showOpenDialog(window, data, processFile);
});
createWindow();
});
// Quit when all windows are closed.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
================================================
FILE: src/preload.js
================================================
const { ipcRenderer } = require('electron');
process.once('loaded', () => {
// ipc communication is handled with postMessage and event listeners since ipcRenderer cannot be imported to renderer
// process for security reasons
window.addEventListener('message', event => {
const message = event.data;
const { data, type } = message;
ipcRenderer.send(type, data);
});
ipcRenderer.on('main-message', (event, payload) => {
const { data, type } = payload;
window.postMessage({
type,
data
}, '*');
});
});
================================================
FILE: src/renderer.js
================================================
import $ from 'jquery';
// we also need to process some styles with webpack
import fontawesome from '@fortawesome/fontawesome';
import { faCloudUploadAlt, faExclamationCircle, faCheckCircle } from '@fortawesome/fontawesome-free-solid';
fontawesome.library.add(faCloudUploadAlt);
fontawesome.library.add(faExclamationCircle);
fontawesome.library.add(faCheckCircle);
import './styles/index.scss';
const drop = document.querySelector('input');
const filesInput = document.querySelector('#files');
const errorArea = document.querySelector('.error-toast');
const notificationArea = document.querySelector('.notification-toast');
const handleIn = () => {
$('.drop').css({
border: '4px dashed #3023AE',
background: 'rgba(0, 153, 255, .05)'
});
$('.cont').css({
color: '#3023AE'
});
};
const handleOut = () => {
$('.drop').css({
border: '3px dashed #DADFE3',
background: 'transparent'
});
$('.cont').css({
color: '#8E99A5'
});
};
const inEvents = ['dragenter', 'dragover'];
const outEvents = ['dragleave', 'dragend', 'mouseout', 'drop'];
inEvents.forEach(event => drop.addEventListener(event, handleIn));
outEvents.forEach(event => drop.addEventListener(event, handleOut));
const excelFileRegex = /(vnd\.ms-excel|vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet)/i;
const handleFileSelect = async event => {
const files = event.target.files;
for (let file of files) {
// Only process excel files.
if (!file.type.match(excelFileRegex)) {
continue;
}
try {
const arrayBuffer = await file.arrayBuffer();
window.postMessage({
type: 'file-dropped',
data: {
file: arrayBuffer,
path: file.path
}
}, '*');
} catch (err) {
console.log(err);
}
}
event.preventDefault();
event.stopPropagation();
};
filesInput.addEventListener('change', handleFileSelect);
const $progress = $('.progress'),
$bar = $('.progress__bar'),
$text = $('.progress__text'),
orange = 30,
yellow = 55,
green = 85;
const resetColors = () => {
$bar.removeClass('progress__bar--green')
.removeClass('progress__bar--yellow')
.removeClass('progress__bar--orange')
.removeClass('progress__bar--blue');
$progress.removeClass('progress--complete');
};
const update = (percent) => {
percent = parseFloat( percent.toFixed(1) );
$text.find('em').text( percent + '%' );
if( percent >= 100 ) {
percent = 100;
$progress.addClass('progress--complete');
$bar.addClass('progress__bar--blue');
$text.find('em').text( 'Complete' );
} else {
if( percent >= green ) {
$bar.addClass('progress__bar--green');
}
else if( percent >= yellow ) {
$bar.addClass('progress__bar--yellow');
}
else if( percent >= orange ) {
$bar.addClass('progress__bar--orange');
}
}
$bar.css({ width: percent + '%' });
};
const processStartHandler = () => {
$progress.addClass('progress--active');
$progress.show();
$('.wrapper').hide();
};
const progressHandler = percentage => update(percentage);
const processCompletedHandler = ({ processedItemsCount, incompatibleItems, erroneousItems, logFilePath }) => {
$(notificationArea).find('.text').text(
[
`${processedItemsCount} item(s) successfully processed,`,
`${incompatibleItems.length} item(s) skipped,`,
`${erroneousItems.length} item(s) erroneous,`,
`Log file ${logFilePath} is written on disk.`
].join('\r\n')
);
$(notificationArea).show().animate({
top: '10%'
}, 'slow');
};
const processErrorHandler = data => {
const oldText = $(errorArea).find('.text').text();
$(errorArea).find('.text').text(
[
`${oldText}`,
`${data.itemInfo} ${data.statusText}`
].join('\r\n')
);
$(errorArea).show().animate({
bottom: '10%'
}, 'slow');
};
const fileErrorHandler = data => {
$(errorArea).find('.text').text(`${data}`);
$(errorArea).show().animate({
bottom: '10%'
}, 'slow');
};
const resetProcess = () => {
resetColors();
update(0);
$('.wrapper').show();
$progress.hide();
};
const errorAreaClickHandler = () => {
$(errorArea).animate({
bottom: 0
}, 'slow', function() { $(this).hide().find('.text').text('')});
};
const notificationAreaClickHandler = () => {
$(notificationArea).animate({
top: 0
}, 'slow', function() { $(this).hide().find('.text').text('')});
errorAreaClickHandler();
resetProcess();
};
errorArea.addEventListener('click', errorAreaClickHandler);
notificationArea.addEventListener('click', notificationAreaClickHandler);
const disableDrop = event => {
if(event.target !== filesInput) {
event.preventDefault();
event.stopPropagation();
}
};
// Prevent loading a drag-and-dropped file
['dragover', 'drop'].forEach(event => {
document.addEventListener(event, disableDrop);
});
window.addEventListener('message', event => {
const message = event.data;
const { data, type } = message;
switch (type) {
case 'process-started':
processStartHandler();
break;
case 'process-completed':
processCompletedHandler(data);
break;
case 'progress':
progressHandler(data);
break;
case 'process-error':
processErrorHandler(data);
break;
case 'file-error':
fileErrorHandler(data);
}
});
================================================
FILE: src/styles/index.scss
================================================
@import '~normalize.css';
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700');
@import "./progress-bar";
@import "./toasts";
$header-height: 120px;
*,
*:before,
*:after {
box-sizing: border-box;
}
body,
html {
font-family: "Montserrat", sans-serif;
font-size: 100%;
font-weight: 400;
color: #323a44;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
}
.wrapper {
width: 100%;
height: calc(100% - #{$header-height});
position: relative;
}
.drop {
width: 96%;
height: 96%;
border: 3px dashed #DADFE3;
border-radius: 15px;
overflow: hidden;
text-align: center;
background: white;
transition: all 0.5s ease-out;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.drop .cont {
width: 500px;
height: 170px;
color: #8E99A5;
transition: all 0.5s ease-out;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.drop .cont i {
font-size: 400%;
color: #8E99A5;
position: relative;
}
.drop .cont .tit {
font-size: 2rem;
text-transform: uppercase;
}
.drop .cont .desc {
color: #A4AEBB;
}
.drop .cont .browse {
margin: 10px 25%;
color: white;
padding: 8px 16px;
border-radius: 5px;
background: #3023AE;
}
.drop input {
width: 100%;
height: 100%;
cursor: pointer;
opacity: 0;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.app {
&__header {
background: linear-gradient(
135deg,
#1b1253, #673a74
);
color: #fff;
height: $header-height;
padding: 10px;
&__logo {
display: inline-block;
vertical-align: middle;
}
}
&__title {
display: inline-block;
margin: 0 0 0 10px;
text-transform: uppercase;
}
&__description {
font-style: italic;
}
}
================================================
FILE: src/styles/progress-bar.scss
================================================
$red: #c90414;
$blue: #1287cc;
$green: #00b217;
$yellow: #e89e00;
$orange: #c92f00;
@mixin innerColor( $color: #0db6e0 ) {
background-color: transparentize( $color , 0.05 );
background-image:
linear-gradient(
90deg,
transparentize( lighten( $color, 5% ), 1 ) 10%,
transparentize( lighten( $color, 10% ), 0.2 ) 30%,
transparentize( lighten( $color, 15% ), 0 ) 70%,
transparentize( lighten( $color, 10% ), 0.2 ) 80%,
transparentize( lighten( $color, 5% ), 1 ) 90%
),
linear-gradient(
to right,
transparentize( lighten( $color, 15% ), 1 ) 0%,
transparentize( lighten( $color, 15% ), 0 ) 100%
),
linear-gradient(
to left,
transparentize( lighten( $color, 15% ), 1 ) 0%,
transparentize( lighten( $color, 15% ), 0 ) 100%
);
border-color: lighten( $color, 20% );
box-shadow:
0 0 0.6em lighten( $color, 10% ) inset,
0 0 0.4em lighten( $color, 5% ) inset,
0 0 0.5em transparentize( $color, 0.5),
0 0 0.1em transparentize( lighten( $color, 50% ), 0.5);
}
.progress {
background: rgba(255,255,255,0.05);
border-radius: 2px;
border: 1px solid rgba(255,255,255,0.2);
display: none;
font-size: 1.2em;
height: 20px;
margin: 2rem;
&--active .progress__bar {
opacity: 1;
}
&__text {
width: 20em;
padding: 0 0.9em;
position: absolute;
em {
font-style: normal;
}
}
&__bar {
color: white;
font-size: 12px;
font-weight: normal;
text-shadow: 0 1px 1px rgba(0,0,0,0.6);
line-height: 19px;
display: block;
position: relative;
top: -1px;
left: -1px;
width: 0;
height: 100%;
opacity: 0;
border: 1px solid;
border-radius: 2px 0 0 2px;
background-size: 100px 30px, 130px 30px, 130px 30px;
background-position: -20% center, right center, left center;
background-repeat: no-repeat, no-repeat, no-repeat;
transition:
opacity 0.2s ease,
width 0.8s ease-out,
background-color 1s ease,
border-color 0.3s ease,
box-shadow 1s ease;
animation: pulse 2s ease-out infinite;
@include innerColor($red);
&--orange {
@include innerColor($orange);
}
&--yellow {
@include innerColor($yellow);
}
&--green {
@include innerColor($green);
}
&--blue {
@include innerColor($blue);
}
&:before,
&:after {
content: "";
position: absolute;
right: -1px;
top: -10px;
width: 1px;
height: 40px;
}
&:before {
width: 7px;
right: -4px;
background:
radial-gradient(
ellipse at center,
rgba(255,255,255,0.4) 0%,
rgba(255,255,255,0) 75%
);
}
&:after {
background:
linear-gradient(
to bottom,
rgba(255,255,255,0) 0%,
rgba(255,255,255,0.3) 25%,
rgba(255,255,255,0.3) 75%,
rgba(255,255,255,0) 100%
);
}
}
&--complete {
.progress__bar {
animation: none;
border-radius: 2px;
&:after,
&:before {
opacity: 0;
}
}
}
}
@keyframes pulse {
0% {
background-position: -50% center, right center, left center;
}
100% {
background-position: 150% center, right center, left center;
}
}
================================================
FILE: src/styles/toasts.scss
================================================
.error-toast, .notification-toast {
display: none;
position: absolute;
text-align: center;
width: 70%;
border-radius: 0.5rem;
color: #fff;
font-size: 1rem;
padding: 1rem;
left: 0;
right: 0;
cursor: pointer;
margin: 0 auto;
.text {
display: block;
padding: 1rem;
white-space: pre-wrap;
text-align: left;
}
}
.error-toast {
background-color: rgba(156, 41, 49, 0.8);
bottom: 0;
}
.notification-toast {
background-color: rgba(71, 70, 139, 0.8);
top: 0;
}
================================================
FILE: src/utils/generateFileName.js
================================================
const extensionRegex = /\.([a-zA-Z0-9]+)$/ig
const trailingDotRegex = /\.$/g
const trimTrailingDot = name => {
const hasTrailingDot = trailingDotRegex.test(name);
return hasTrailingDot ? name.replace(trailingDotRegex, '') : name;
}
export default (name, extension) => {
const hasExtension = name.match(extensionRegex);
name = trimTrailingDot(name);
return hasExtension ? name: `${name}.${extension}`;
}
================================================
FILE: src/utils/generateFileName.spec.js
================================================
import generateFileName from './generateFileName';
test('generateFileName should be a function', () => {
expect(typeof generateFileName).toBe('function');
});
test('should generate the correct file name when file name is extension free', () => {
const fileName = generateFileName('sample', 'jpg');
expect(fileName).toBe('sample.jpg');
});
test('should generate the correct file name when file name has an extension', () => {
let fileName = generateFileName('sample.avif', 'avif');
expect(fileName).toBe('sample.avif');
fileName = generateFileName('sample.gif');
expect(fileName).toBe('sample.gif');
});
test('should generate the correct file name when file name is erroneous', () => {
const fileName = generateFileName('sample.', 'gif');
expect(fileName).toBe('sample.gif');
});
================================================
FILE: src/utils/processItems.js
================================================
import path from 'node:path';
import { createWriteStream } from 'node:fs';
import { mkdir } from 'node:fs/promises';
import { pipeline } from 'node:stream/promises';
import fetch from 'electron-fetch';
import { URL } from 'node:url';
import { read, utils } from 'xlsx';
import isUrl from 'is-url';
import mime from 'mime-types';
import generateFileName from './generateFileName';
let initialItemsLength;
let processedItemsCount;
let incompatibleItems = [];
let erroneousItems = [];
const _resetProcessData = () => {
initialItemsLength = 0;
processedItemsCount = 0;
incompatibleItems.length = 0;
erroneousItems.length = 0;
};
const processItem = async (item, outputPath) => {
const [ itemUrl, newName, subFolderName ] = item;
const url = new URL(itemUrl);
const itemName = newName ? `${newName}${path.extname(url.pathname)}` : path.basename(url.pathname);
// usage of 'If-None-Match' header is just to force the server not to return an 304 since electron net does not
// correctly return content-type headers when converting an 304 to 200 internally
// see issues https://github.com/electron/electron/issues/27895, https://github.com/electron/electron/pull/21552
// and https://github.com/electron/electron/issues/20631
const response = await fetch(itemUrl, {headers: {'If-None-Match': null}});
if (response.ok) {
if (subFolderName) {
await mkdir(`${outputPath}/${subFolderName}`, { recursive: true }, () => {});
}
const contentType = response.headers.get('content-type');
const extension = mime.extension(contentType);
const fileName = generateFileName(itemName, extension);
// file system flag 'wx' stands for:
// Open file for writing. The file is created (if it does not exist), but fails if the path exists. (x causes to throw)
const dest = createWriteStream(path.join(outputPath, subFolderName || '', fileName), {flags: 'wx'});
try {
await pipeline(response.body, dest);
} catch (error) {
throw {
statusText: error.message,
itemInfo: error.path
}
}
} else {
throw {
status: response.status,
statusText: response.statusText,
itemInfo: url.href
}
}
};
const processItems = async (rowItems, outputPath, win) => {
const itemsLength = rowItems.length;
for (let i = 0; i < itemsLength; i += 20) {
const requests = rowItems
.slice(i, i + 20)
.map(item => processItem(item, outputPath)
.then(() => {
const unprocessedItems = erroneousItems.length + incompatibleItems.length;
const percentage = Math.abs(++processedItemsCount / (initialItemsLength - unprocessedItems)) * 100;
win.webContents.send('main-message', {
type: 'progress',
data: percentage
});
})
.catch(err => {
erroneousItems.push(err.itemInfo);
win.webContents.send('main-message', {
type: 'process-error',
data: err
});
})
);
await Promise.allSettled(requests);
}
const logFileStream = createWriteStream(path.join(
outputPath,
`excel-parser-processor-log${Date.now()}.txt`)
);
logFileStream.write(
[
`Processed Items Count: ${processedItemsCount}`,
'-----',
`Incompatible Items Count: ${incompatibleItems.length};`,
`${incompatibleItems.join('\r\n')}`,
'-----',
`Erroneous Items Count: ${erroneousItems.length};`,
`${erroneousItems.join('\r\n')}`,
'-----'
].join('\r\n'), 'utf8');
logFileStream.on('finish', () => {
win.webContents.send('main-message', {
type: 'process-completed',
data: {
processedItemsCount,
incompatibleItems,
erroneousItems,
logFilePath: logFileStream.path
}
});
});
logFileStream.end();
};
export const processFile = async (file, outputPath, browserWindow) => {
_resetProcessData();
const workbook = read(file);
// get all the work Sheets in the file
const wsNames = workbook.SheetNames;
// filter out the sheets without no rows
const AllSheetsData = wsNames.map(
name => utils.sheet_to_json(workbook.Sheets[name], { header: 1, blankrows: false })
).filter(item => item.length).flat();
const validRows = AllSheetsData.filter(row => row.some(text => isUrl(text)));
incompatibleItems = AllSheetsData.filter(row => !row.some(text => isUrl(text)));
initialItemsLength = validRows.length;
if (initialItemsLength) {
browserWindow.webContents.send('main-message', {
type: 'process-started'
});
await processItems(validRows, outputPath, browserWindow);
} else {
browserWindow.webContents.send('main-message', {
type: 'file-error',
data: 'No item to process'
});
}
};
================================================
FILE: src/utils/processItems.spec.js
================================================
import { processFile } from './processItems';
test('processFile should be a function', () => {
expect(typeof processFile).toBe('function');
});
================================================
FILE: webpack.dev.js
================================================
const path = require('path');
const processType = process.env.PROCESS_TYPE;
const configPath = `webpack.${processType === 'main' ? 'main' : 'renderer'}.js`;
module.exports = {
extends: path.resolve(__dirname, configPath),
devtool: 'eval-cheap-module-source-map',
devServer: {
static: {
directory: path.join(__dirname, 'dist'),
},
hot: true
},
mode: 'development'
};
================================================
FILE: webpack.main.js
================================================
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
const webpack = require('webpack');
const devMode = process.env.NODE_ENV === 'development';
// define webpack plugins
const cleanDist = new CleanWebpackPlugin();
const mainConfig = {
name: 'main',
entry: {
index: './src/index.js'
},
plugins: [
cleanDist,
new CopyPlugin({
patterns: [
{
from: './src/images/',
to: 'images'
},
{
from: './src/preload.js',
to: 'preload.js',
toType: 'file'
}
],
}),
...(devMode ? [
new webpack.HotModuleReplacementPlugin({
multiStep: true
})] : []
)
],
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
'cacheDirectory': true,
}
}
}
]
},
//not to mock __dirname and such node globals
node: false,
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
target: 'electron-main',
watch: devMode
};
module.exports = mainConfig
================================================
FILE: webpack.prod.js
================================================
const path = require("path");
const processType = process.env.PROCESS_TYPE;
const configPath = `webpack.${processType === 'main' ? 'main' : 'renderer'}.js`;
module.exports = {
extends: path.resolve(__dirname, configPath),
mode: 'production'
};
================================================
FILE: webpack.renderer.js
================================================
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const devMode = process.env.NODE_ENV === 'development';
// define webpack plugins
const extractSass = new MiniCssExtractPlugin({
filename: devMode ? '[name].css' : '[name].[contenthash:12].css',
chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
});
const processHtml = new HtmlWebpackPlugin({
meta: {
'Content-Security-Policy':
{
'http-equiv': 'Content-Security-Policy',
content: `default-src 'self' ${devMode ? "'unsafe-eval'": ''}; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com;`
}
},
hash: true,
template: './src/index.html',
title: 'Simply process Excel files',
});
const rendererConfig = {
name: 'renderer',
entry: {
renderer: './src/renderer.js'
},
plugins: [
...(devMode ? [] : [extractSass]),
processHtml
],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
'cacheDirectory': true,
}
}
},
{
test: /\.scss$/,
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
}
]
},
//not to mock __dirname and such node globals
node: false,
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
target: ['web', 'electron-renderer']
};
module.exports = rendererConfig
gitextract_yw4frl62/ ├── .babelrc ├── .browserslistrc ├── .editorconfig ├── .github/ │ ├── FUNDING.yml │ ├── dependabot.yml │ └── workflows/ │ ├── codeql-analysis.yml │ └── main.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── build/ │ └── icons/ │ └── mac/ │ └── icon.icns ├── icon.sketch ├── package.json ├── src/ │ ├── dialogs.js │ ├── index.html │ ├── index.js │ ├── preload.js │ ├── renderer.js │ ├── styles/ │ │ ├── index.scss │ │ ├── progress-bar.scss │ │ └── toasts.scss │ └── utils/ │ ├── generateFileName.js │ ├── generateFileName.spec.js │ ├── processItems.js │ └── processItems.spec.js ├── webpack.dev.js ├── webpack.main.js ├── webpack.prod.js └── webpack.renderer.js
Condensed preview — 32 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (59K chars).
[
{
"path": ".babelrc",
"chars": 285,
"preview": "{\n \"presets\": [\n [\n \"@babel/preset-env\",\n {\n \"useBuiltIns\": \"usage\",\n \"corejs\": {\n "
},
{
"path": ".browserslistrc",
"chars": 15,
"preview": "electron >= 19\n"
},
{
"path": ".editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": ".github/FUNDING.yml",
"chars": 105,
"preview": "# These are supported funding model platforms\n\ngithub: [btargac]\nopen_collective: excel-parser-processor\n"
},
{
"path": ".github/dependabot.yml",
"chars": 375,
"preview": "version: 2\nupdates:\n # Enable version updates for npm\n - package-ecosystem: \"npm\"\n # Look for `package.json` and `l"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 2440,
"preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
},
{
"path": ".github/workflows/main.yml",
"chars": 1118,
"preview": "name: Build & release\non:\n push:\n branches:\n - 'master'\n pull_request:\n branches:\n - 'master'\n workfl"
},
{
"path": ".gitignore",
"chars": 928,
"preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directo"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3226,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "CONTRIBUTING.md",
"chars": 9997,
"preview": "# Contributing to excel-parser-processor\n\nWe would love for you to contribute to excel-parser-processor and help make it"
},
{
"path": "LICENSE",
"chars": 1069,
"preview": "MIT License\n\nCopyright (c) 2018 Burak Targaç\n\nPermission is hereby granted, free of charge, to any person obtaining a co"
},
{
"path": "README.md",
"chars": 6493,
"preview": "# <img src=\"build/icons/128x128.png\" width=\"64px\" align=\"center\" alt=\"Excel Parser Processor\"> Excel Parser Processor\n\n#"
},
{
"path": "SECURITY.md",
"chars": 593,
"preview": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported |\n| ------- | ------------------ |\n| > 1.1 | "
},
{
"path": "package.json",
"chars": 3877,
"preview": "{\n \"name\": \"excel-parser-processor\",\n \"productName\": \"Excel Parser Processor\",\n \"version\": \"1.4.1\",\n \"description\": "
},
{
"path": "src/dialogs.js",
"chars": 500,
"preview": "import { dialog } from 'electron';\n\nexport const showOpenDialog = async (browserWindow, data, cb) => {\n try {\n const"
},
{
"path": "src/index.html",
"chars": 1507,
"preview": "<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\"\n content=\"width=device-w"
},
{
"path": "src/index.js",
"chars": 1371,
"preview": "import path from 'path';\nimport { app, BrowserWindow, ipcMain } from 'electron';\nimport { showOpenDialog } from './dialo"
},
{
"path": "src/preload.js",
"chars": 552,
"preview": "const { ipcRenderer } = require('electron');\n\nprocess.once('loaded', () => {\n // ipc communication is handled with post"
},
{
"path": "src/renderer.js",
"chars": 5376,
"preview": "import $ from 'jquery';\n\n// we also need to process some styles with webpack\nimport fontawesome from '@fortawesome/fonta"
},
{
"path": "src/styles/index.scss",
"chars": 1868,
"preview": "@import '~normalize.css';\n@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700');\n@import \"./progress"
},
{
"path": "src/styles/progress-bar.scss",
"chars": 3403,
"preview": "$red: #c90414;\n$blue: #1287cc;\n$green: #00b217;\n$yellow: #e89e00;\n$orange: #c92f00;\n\n@mixin innerColor( $color: #0db6e0 "
},
{
"path": "src/styles/toasts.scss",
"chars": 507,
"preview": ".error-toast, .notification-toast {\n display: none;\n position: absolute;\n text-align: center;\n width: 70%;\n border-"
},
{
"path": "src/utils/generateFileName.js",
"chars": 417,
"preview": "const extensionRegex = /\\.([a-zA-Z0-9]+)$/ig\nconst trailingDotRegex = /\\.$/g\n\nconst trimTrailingDot = name => {\n const "
},
{
"path": "src/utils/generateFileName.spec.js",
"chars": 804,
"preview": "import generateFileName from './generateFileName';\n\ntest('generateFileName should be a function', () => {\n expect(typeo"
},
{
"path": "src/utils/processItems.js",
"chars": 4792,
"preview": "import path from 'node:path';\nimport { createWriteStream } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimp"
},
{
"path": "src/utils/processItems.spec.js",
"chars": 147,
"preview": "import { processFile } from './processItems';\n\ntest('processFile should be a function', () => {\n expect(typeof processF"
},
{
"path": "webpack.dev.js",
"chars": 396,
"preview": "const path = require('path');\nconst processType = process.env.PROCESS_TYPE;\n\nconst configPath = `webpack.${processType ="
},
{
"path": "webpack.main.js",
"chars": 1246,
"preview": "const path = require('path');\nconst { CleanWebpackPlugin } = require('clean-webpack-plugin');\nconst CopyPlugin = require"
},
{
"path": "webpack.prod.js",
"chars": 250,
"preview": "const path = require(\"path\");\nconst processType = process.env.PROCESS_TYPE;\n\nconst configPath = `webpack.${processType ="
},
{
"path": "webpack.renderer.js",
"chars": 1667,
"preview": "const path = require('path');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nconst HtmlWebpackPlugin ="
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the btargac/excel-parser-processor GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 32 files (54.2 KB), approximately 14.8k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.