diff --git a/Readme.md b/Readme.md index 896ee92..1a53db6 100644 --- a/Readme.md +++ b/Readme.md @@ -17,13 +17,13 @@ yarn add @smakss/random-array-element to include it with common js module you should do this: ```js -var randomArrayElement = require('@smakss/random-array-element'); +var randomArrayElement = require("@smakss/random-array-element"); ``` and to include it with ECMAscript module you can simply do this one: ```js -import randomArrayElement from '@smakss/random-array-element'; +import randomArrayElement from "@smakss/random-array-element"; ``` then to use it within your application you can do it just like this: @@ -36,7 +36,7 @@ const chooser = randomArrayElement(); ``` ```js -const chooser = randomArrayElement(['Foo', 'Bar', 'FU', 'FooBar']); +const chooser = randomArrayElement(["Foo", "Bar", "FU", "FooBar"]); // Initiating the selector once and then we can use the returned function to select random none repeatable elements from the array. chooser(); @@ -59,3 +59,7 @@ chooser(); ## Demo You can check the [working demo](https://runkit.com/smakss/random-array-element) in runkit. + +or + +[![View @smakss/random-array-element](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/smakss-random-array-element-7yizos?fontsize=14&hidenavigation=1&theme=dark) diff --git a/package.json b/package.json index 4701603..0c9911b 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,14 @@ { - "name": "@smakss/random-array-element", - "version": "1.2.3", + "author": "SMAKSS", + "bugs": { + "url": "https://github.com/SMAKSS/random-array-element/issues" + }, "description": "Selects a random unique array element without repetition from provided array.", - "type": "module", - "main": "./index.cjs", "exports": { "import": "./index.mjs", "require": "./index.cjs" }, - "repository": { - "type": "git", - "url": "git+https://github.com/SMAKSS/random-array-element.git" - }, + "homepage": "https://github.com/SMAKSS/random-array-element#readme", "keywords": [ "npm", "yarn", @@ -25,10 +22,13 @@ "random-element-without-repeat", "random-array-element-without-repetition" ], - "author": "SMAKSS", "license": "MIT", - "bugs": { - "url": "https://github.com/SMAKSS/random-array-element/issues" + "main": "./index.cjs", + "name": "@smakss/random-array-element", + "repository": { + "type": "git", + "url": "git+https://github.com/SMAKSS/random-array-element.git" }, - "homepage": "https://github.com/SMAKSS/random-array-element#readme" + "type": "module", + "version": "1.2.4" }