Skip to content

Commit

Permalink
lovemate npm package with stable release version
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmuhtasimfuadfahim committed Jun 2, 2024
1 parent 1ccec75 commit 5ff330b
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
soulamte-voice.mp3
lovemate-voice.mp3
package-lock.json
.DS_Store
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Changelog

All notable changes to the `soulmate` package will be documented in this file.
All notable changes to the `lovemate` package will be documented in this file.

## [0.0.5] - 2024-06-02
## [1.0.0] - 2024-06-02

### Added

- Initial release of the `soulmate` package.
- Initial release of the `lovemate` package.
- Support for multiple languages as listed in the [README.md](README.md).
- Dependencies: `google-tts-api`, `google-translate-api-x`, `play-sound`.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[![NPM Version](https://img.shields.io/npm/v/soulmate.svg?style=flat-square)](https://www.npmjs.com/package/soulmate) [![NPM Monthly Downloads](https://img.shields.io/npm/dm/soulmate?style=flat-square)](https://npmjs.org/package/soulmate)
[![NPM Version](https://img.shields.io/npm/v/lovemate.svg?style=flat-square)](https://www.npmjs.com/package/lovemate) [![NPM Monthly Downloads](https://img.shields.io/npm/dm/lovemate?style=flat-square)](https://npmjs.org/package/lovemate)

[![Last Commit](https://img.shields.io/github/last-commit/mdmuhtasimfuadfahim/soulmate?style=flat-square)](https://github.com/mdmuhtasimfuadfahim/soulmate/commits/) ![Language Most Used](https://img.shields.io/github/languages/top/mdmuhtasimfuadfahim/soulmate?style=flat-square) [![Implementations](https://img.shields.io/badge/%F0%9F%92%A1-implementations-8C8E93.svg?style=flat-square)](https://github.com/mdmuhtasimfuadfahim/soulmate/issues) ![Repository Size](https://img.shields.io/github/repo-size/mdmuhtasimfuadfahim/soulmate?style=flat-square)
[![Last Commit](https://img.shields.io/github/last-commit/mdmuhtasimfuadfahim/lovemate?style=flat-square)](https://github.com/mdmuhtasimfuadfahim/lovemate/commits/) ![Language Most Used](https://img.shields.io/github/languages/top/mdmuhtasimfuadfahim/lovemate?style=flat-square) [![Implementations](https://img.shields.io/badge/%F0%9F%92%A1-implementations-8C8E93.svg?style=flat-square)](https://github.com/mdmuhtasimfuadfahim/lovemate/issues) ![Repository Size](https://img.shields.io/github/repo-size/mdmuhtasimfuadfahim/lovemate?style=flat-square)

[![Forks](https://img.shields.io/github/forks/mdmuhtasimfuadfahim/soulmate?style=social)](https://github.com/mdmuhtasimfuadfahim/soulmate/network/members) [![Stars](https://img.shields.io/github/stars/mdmuhtasimfuadfahim/soulmate?style=social)](https://github.com/mdmuhtasimfuadfahim/soulmate/stargazers) [![Watches](https://img.shields.io/github/watchers/mdmuhtasimfuadfahim/soulmate?style=social)](https://github.com/mdmuhtasimfuadfahim/soulmate/watchers)
[![Forks](https://img.shields.io/github/forks/mdmuhtasimfuadfahim/lovemate?style=social)](https://github.com/mdmuhtasimfuadfahim/lovemate/network/members) [![Stars](https://img.shields.io/github/stars/mdmuhtasimfuadfahim/lovemate?style=social)](https://github.com/mdmuhtasimfuadfahim/lovemate/stargazers) [![Watches](https://img.shields.io/github/watchers/mdmuhtasimfuadfahim/lovemate?style=social)](https://github.com/mdmuhtasimfuadfahim/lovemate/watchers)

[![Author GitHub](https://img.shields.io/github/followers/mdmuhtasimfuadfahim?label=Follow&style=social)](https://github.com/mdmuhtasimfuadfahim)

# soulmate 💖🎵
# lovemate 💖🎵

`soulmate` is a fun npm package designed to express affectionate phrases in various languages through voice.
`lovemate` is a fun npm package designed to express affectionate phrases in various languages through voice.

## Table of Contents

Expand All @@ -29,7 +29,7 @@ Solumate provides an extensive repertoire of romantic phrases in over `30+` lang
## Supported Languages

`soulmate` supports a wide range of languages, including:
`lovemate` supports a wide range of languages, including:

- `af-ZA`: Afrikaans (South Africa)
- `ar-XA`: Arabic (Gulf)
Expand Down Expand Up @@ -72,37 +72,37 @@ Solumate provides an extensive repertoire of romantic phrases in over `30+` lang

## Dependencies and API

`soulmate` uses the following npm packages:
`lovemate` uses the following npm packages:

- `google-tts-api`: This package is used to generate the audio files from the translated phrases.
- `google-translate-api-x`: This package is used to translate the phrases into the desired language.
- `play-sound`: This package is used to play the generated audio files.

In addition, `soulmate` uses the `quotable.io` API to fetch random love quotes.
In addition, `lovemate` uses the `quotable.io` API to fetch random love quotes.

## Installation

To install `soulmate`, use npm or yarn:
To install `lovemate`, use npm or yarn:

```sh
npm install soulmate
npm install lovemate
```

or

```sh
yarn add soulmate
yarn add lovemate
```

## Usage

```sh
const soulmateVoice = require("soulmate");
const lovemateVoice = require("lovemate");

(async () => {
try {
const language = "bn-IN"; // Specify the language (e.g., 'en-US' for English, 'es-ES' for Spanish, etc.)
const phrase = await soulmateVoice(language); // for English you don't need to pass the language parameter
const phrase = await lovemateVoice(language); // for English you don't need to pass the language parameter
console.log("Message played successfully!", phrase);
} catch (error) {
console.error("Error:", error.message);
Expand Down Expand Up @@ -137,7 +137,7 @@ Contributions, issues, and feature requests are what make the open-source commun
- Push to the Branch (`git push origin feature/AmazingFeature`)
- Open a Pull Request
Feel free to check the [issues page](https://github.com/mdmuhtasimfuadfahim/soulmate/issues) for any existing issues or to create a new one.
Feel free to check the [issues page](https://github.com/mdmuhtasimfuadfahim/lovemate/issues) for any existing issues or to create a new one.
- Contributions, issues and features requests are welcome!
- 📮 Submit PRs to help solve issues or add features
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "soulmate",
"version": "0.0.5",
"name": "lovemate",
"version": "1.0.0",
"description": "A package that says affectionate phrases in various languages.",
"main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/mdmuhtasimfuadfahim/soulmate.git"
"url": "https://github.com/mdmuhtasimfuadfahim/lovemate.git"
},
"scripts": {
"start": "node example.js"
Expand All @@ -21,9 +21,9 @@
"author": "Md. Muhtasim Fuad Fahim <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/mdmuhtasimfuadfahim/soulmate/issues"
"url": "https://github.com/mdmuhtasimfuadfahim/lovemate/issues"
},
"homepage": "https://github.com/mdmuhtasimfuadfahim/soulmate#readme",
"homepage": "https://github.com/mdmuhtasimfuadfahim/lovemate#readme",
"dependencies": {
"axios": "^1.7.2",
"google-translate-api-x": "^10.6.8",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/fallbackPhrases.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,4 @@ const fallbackPhrases = {
]
};

module.exports = fallbackPhrases;
module.exports = fallbackPhrases;
1 change: 0 additions & 1 deletion src/helpers/getPhrases.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const getPhrases = async (language = 'en-US') => {

// Translate the quote to the specified language
const translated = await translate(phrase, { to: language.split('-')[0] });

return translated.text;
} catch (error) {
console.error('Error fetching or translating phrases:', error.message);
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const getVoiceUrl = (text, lang) => {

/*
----------------------------
Function name: soulmateVoice
Function name: lovemateVoice
----------------------------
This function generates the voice from text using Google Text-to-Speech API.
It takes one parameter: the language code.
*/
const soulmateVoice = async (language = 'en-US') => {
const lovemateVoice = async (language = 'en-US') => {
try {
// Check if the language is supported
if (!languages[language]) {
Expand All @@ -41,7 +41,7 @@ const soulmateVoice = async (language = 'en-US') => {
// Generate the URL for the Google Text-to-Speech API
const url = getVoiceUrl(text, language);
// Define the path for the output file
const filePath = path.join(__dirname, 'soulamte-voice.mp3');
const filePath = path.join(__dirname, 'lovemate-voice.mp3');

// Send a GET request to the Google Text-to-Speech API
const response = await axios({
Expand Down Expand Up @@ -70,4 +70,4 @@ const soulmateVoice = async (language = 'en-US') => {
}
};

module.exports = soulmateVoice;
module.exports = lovemateVoice;
4 changes: 2 additions & 2 deletions src/languages.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Supported language list
// Supported language list by Google Text-to-Speech API (Standard)
const languages = {
'af-ZA': 'Afrikaans (South Africa)',
'ar-XA': 'Arabic (Gulf)',
Expand Down Expand Up @@ -40,4 +40,4 @@ const languages = {
'zh-TW': 'Chinese (Mandarin, Traditional)'
};

module.exports = languages;
module.exports = languages;
4 changes: 2 additions & 2 deletions src/test/example.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const soulmateVoice = require('../index');
const lovemateVoice = require('../index');

(async () => {
try {
const result = await soulmateVoice('bn-IN'); // Bengali voice
const result = await lovemateVoice('bn-IN'); // Bengali voice
console.log('Message played successfully!', result);
} catch (error) {
console.error('Error:', error.message);
Expand Down

0 comments on commit 5ff330b

Please sign in to comment.