diff --git a/README.md b/README.md index 164c3f9..1ba3151 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ### About -A JavaScript library for efficient manipulation of vowels within strings. Count, transform case, extract positions, and perform various operations on vowels with ease. +A JavaScript library for efficient manipulation of vowels within strings. Count, transform case, extract positions, and perform various operations on vowels with ease.

### Getting Started @@ -20,16 +20,16 @@ import Vowelz from "vowelz"; - Create a class instance of the imported package and then you can, directly use a method. More details about the method APIS in the following section ```javascript /* node module imports */ -import Vowelz from "vowelz"; +const Vowelz = require("vowelz"); /* create an instance and use methods... */ -const vowelz = new Vowelz(); -console.log("How many vowels are there in the word: ", vowelz.getCount("hello world")); +const myVowelz = new Vowelz(); +console.log("How many vowels are there in the word: ", myVowelz.getTotalCount("hello world")); ```
### Usage (Methods/API) -- ```getCount(arg: string):``` returns the number of vowels that are present in a string value. Takes in one argument which must be a string only. +- ```getTotalCount(arg: string):``` returns the number of vowels that are present in a string value. Takes in one argument which must be a string only. - ```getPositionsOfVowels(arg: string):``` returns the index values of the vowels that are present in a string value. Takes in one argument which must be a string only. - ```extractAllVowelsFromString(arg: string):``` returns all of the vowels that are present in a string. Takes in one argument which must be a string only. - ```getCountOfUniqueVowels(arg: string):``` returns the number of vowels in a string (non repeating). Takes in one argument which must be a string only. diff --git a/dist/index.js b/dist/index.js index 1d52ec2..8cb4b0a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,9 +1,5 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = void 0; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } @@ -176,4 +172,4 @@ var Vowelz = /*#__PURE__*/function () { }]); return Vowelz; }(); -var _default = exports["default"] = Vowelz; \ No newline at end of file +module.exports = Vowelz; \ No newline at end of file diff --git a/index.js b/index.js index 37a8a12..cf8df50 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,2 @@ -const Vowelz = require("./dist").default; +const Vowelz = require("./dist"); module.exports = Vowelz; diff --git a/package.json b/package.json index b95b016..71a2046 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,9 @@ { "name": "vowelz", - "version": "1.2.4", + "version": "2.0.0", "description": "A JavaScript library for efficient manipulation of vowels within strings. Count, transform case, extract positions, and perform various operations on vowels with ease. Enhance your text processing and string transformations using Vowelz.", "main": "index.js", "homepage": "https://github.com/sricharankrishnan/vowelz", - "type": "module", "scripts": { "build": "babel ./src -d ./dist", "test" : "jest --verbose" diff --git a/src/index.js b/src/index.js index 324a334..ebbaaf6 100644 --- a/src/index.js +++ b/src/index.js @@ -148,4 +148,4 @@ class Vowelz { return arg.replace(/[aeiou]/gi, ''); } } -export default Vowelz; +module.exports = Vowelz; diff --git a/tests/accepts-only-string-arg.test.js b/tests/accepts-only-string-arg.test.js index 03941b6..b8af513 100644 --- a/tests/accepts-only-string-arg.test.js +++ b/tests/accepts-only-string-arg.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - Methods Accepts Only String Args", () => { diff --git a/tests/count-all-vowels.test.js b/tests/count-all-vowels.test.js index 9235d9b..311af3d 100644 --- a/tests/count-all-vowels.test.js +++ b/tests/count-all-vowels.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - countAllVowels method", () => { diff --git a/tests/extract-all-vowels-from-string.test.js b/tests/extract-all-vowels-from-string.test.js index 64ecec0..5212207 100644 --- a/tests/extract-all-vowels-from-string.test.js +++ b/tests/extract-all-vowels-from-string.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - extractAllVowelsFromString method", () => { diff --git a/tests/get-count-of-unique-vowels.test.js b/tests/get-count-of-unique-vowels.test.js index c075309..2f71521 100644 --- a/tests/get-count-of-unique-vowels.test.js +++ b/tests/get-count-of-unique-vowels.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - getCountOfUniqueVowels method", () => { diff --git a/tests/get-position-of-vowels.test.js b/tests/get-position-of-vowels.test.js index ca5db47..9655318 100644 --- a/tests/get-position-of-vowels.test.js +++ b/tests/get-position-of-vowels.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - getPositionsOfVowels method", () => { diff --git a/tests/get-total-count-of-vowels.test.tsx b/tests/get-total-count-of-vowels.test.tsx index 7920ddd..9c426b1 100644 --- a/tests/get-total-count-of-vowels.test.tsx +++ b/tests/get-total-count-of-vowels.test.tsx @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - getTotalCount method", () => { diff --git a/tests/remove-all-vowels-from-string.test.js b/tests/remove-all-vowels-from-string.test.js index 9f91faf..375d815 100644 --- a/tests/remove-all-vowels-from-string.test.js +++ b/tests/remove-all-vowels-from-string.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - removeAllVowelsFromString method", () => { diff --git a/tests/replace-vowels-with-character.test.js b/tests/replace-vowels-with-character.test.js index 9df3bed..2bb3b0f 100644 --- a/tests/replace-vowels-with-character.test.js +++ b/tests/replace-vowels-with-character.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - replaceVowelsWithCharacter method", () => { diff --git a/tests/set-vowels-to-lowercase.test.js b/tests/set-vowels-to-lowercase.test.js index 666a1cf..f3efb5e 100644 --- a/tests/set-vowels-to-lowercase.test.js +++ b/tests/set-vowels-to-lowercase.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - setAllVowelsToLowerCase method", () => { diff --git a/tests/set-vowels-to-uppercase.test.js b/tests/set-vowels-to-uppercase.test.js index ee92f7b..b296600 100644 --- a/tests/set-vowels-to-uppercase.test.js +++ b/tests/set-vowels-to-uppercase.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - setAllVowelsToUpperCase method", () => { diff --git a/tests/vowel-encryption.test.js b/tests/vowel-encryption.test.js index a073e00..8aa26d8 100644 --- a/tests/vowel-encryption.test.js +++ b/tests/vowel-encryption.test.js @@ -1,5 +1,5 @@ /* app imports */ -import Vowelz from "../src/index.js"; +const Vowelz = require("../src/index.js"); /* t-suite */ describe("Vowelz - vowelEncryption method", () => {