Skip to content

Commit

Permalink
Intial commit with complete library setup
Browse files Browse the repository at this point in the history
  • Loading branch information
arshadkazmi42 committed Aug 25, 2019
1 parent bf75d44 commit 57c9bd2
Show file tree
Hide file tree
Showing 9 changed files with 1,276 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"node": true,
"mocha": true,
"es6": true
},
"parserOptions": {
"arrowFunctions": true,
"ecmaFeatures": true,
"ecmaVersion": 8,
"sourceType": "module"
},
"extends": "eslint:recommended",
"rules": {
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"no-cond-assign": ["error", "always"],
"no-console": "off"
}
}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "node"
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing

### Thanks, for considering to contribute to this repository!

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

If you are looking forward to start contributing to beautiful world of open source.
**Start it right now.**

The basic guidelines for contributing are as follows:
- Fork the repo
- Clone the repo
- Create a branch using
- `git checkout -b feature-branch`
- Make the required changes
- Test the changes by using below command
- `yarn` (Installs all the dependencies)
- `yarn test`
- Create a pull request using below commands
- `git add --all`
- `git commit -m "your commit message"`
- `git push origin feature-branch`
- Go to [Repository](https://github.com/arshadkazmi42/firefox-user-directory/)
- Create Pull Request against `master` branch
- Add a suitable title and description to the pull request and tag the issue number in Pull Request description, if the pull request is related to some issue logged here: [Issues](https://github.com/arshadkazmi42/firefox-user-directory/issues)
- You're done. Wait for your code to get reviewed and merged
- Optional: Give us a :star: if you like our work :smile:
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# firefox-user-directory
Get abosulte path of firefox user directory - Crossplatform

[![Build](https://img.shields.io/travis/com/arshadkazmi42/firefox-user-directory.svg)](https://travis-ci.com/arshadkazmi42/firefox-user-directory/)

Get firefox user directory crossplatform

## Install

```
npm i firefox-user-directory
```

## Usage

```javascript

const firefoxUserDirectory = require('firefox-user-directory');

const path = firefoxUserDirectory('darwin');
console.log(path);

// Output
// /Users/arshad/Library/Application Support/Firefox

```

## API

- **from(url)**
- Returns domain name from input url

## Contributing

Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/firefox-user-directory/issues/new)

Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase

## Contributors

Thank you to all the contributors who have helped us in making this project better :raised_hands:

<a href="https://github.com/arshadkazmi42"><img src="https://github.com/arshadkazmi42.png" width="30" /></a>
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const os = require('os');
const path = require('path');


module.exports = (platform) => {
switch (platform || os.platform()) {
case 'darwin':
return path.join(process.env.HOME, '/Library/Application Support/Firefox');
case 'linux':
return path.join(process.env.HOME, '/.mozilla/firefox');
case 'win32':
return path.join(process.env.APPDATA, '/Mozilla/Firefox');
default:
throw new Error('Invalid Platform');
}
};
Loading

0 comments on commit 57c9bd2

Please sign in to comment.