Package used for frontend commerce
Build with love ❤️
komerce-package
⚙️ Install
Install it locally in your project folder:
npm i komerce-package
yarn add komerce-package
pnpm add komerce-package
You can also install it globally but it's not recommended.
📖 Usage
Bundle files
import { bundle } from 'komerce-package'
📚 List Packages
utils
cookies
- getCookies, setCookies, removeCookies
formatDate
- (dayjs)
Converts a timestamp to a human-readable relative time.
find
- Finds the first element in the array that satisfies the provided testing function.
generate-acronym
- Generate acronym from string
generate key
- Generate key for encryption
get
- Retrieves a value from an object using the specified path.
includes
- Checks if a value is present in an array.
isAlpha
- Checks if the given string consists of only alphabets.
isEmpty
- Checks if the given value is empty.
isNull
- Checks if a value is null.
localstorage
- getLs, setLs, removeLs enryption with secrety key
notification
- notification with antd
omit
- Creates a new object by omitting specified keys from the source object.
request
- Makes a GET and POST request to the general response json.
secure
- encryption vernam cipher with generate key
xor string
- encryption xor string with generate key
storage
cookies
- getCookies, setCookies, removeCooies yang sudah di modifikasi dengan enkripsi
localstorage
- getLs, setLs, removeLs yang sudah di modifikasi dengan enkripsi
postRequest
- Makes a POST request to the specified URL with the provided request body and returns the response data.
listRequest
- Makes a GET request to the specified URL and returns the response data array.
singleRequest
- Makes a GET request to the specified URL and returns the response data object.