iyasunday
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

iyasunday

Utility functions for nodejs developers and React Developers

postContent: Sends content to servers via HTTP

getContent: Gets content via HTTP

randomString: Generates random strings

uniqueString: Generate unique strings

uploadFile: Upload file from location to server

rand: Generate random number given a range

encrypt: Generate a cipher text of any string passed

decrypt: Generate plain text of supplied cipher text encrypted using encryt function above

errorMessage: Generate nice error message of any exception passed

deleteFile: Delete file from the file system

decodeJwt: Decodes JWT Token

fileExists: Checks if file exists in the file system

md5: Generates md5 hash of passed string

InvalidTokenError: Throw INVALID_TOKEN_ERROR with corresponded HTTP STATUS CODE

TokenExpiredError: Throw INVALID_EXPIRE_ERROR with corresponded HTTP STATUS CODE

AuthenticationError: Throw AUTHENTICATION_ERROR with corresponded HTTP STATUS CODE

AuthorizationError: Throw AUTHORIZATION_ERROR with corresponded HTTP STATUS CODE

EntryExistError: Throw ENTRY_EXIST_ERROR with corresponded HTTP STATUS CODE

EntryNotFoundError: Throw ENTRY_NOT_FOUND_ERROR with corresponded HTTP STATUS CODE

ValidationError: Throw VALIDATION_ERROR with corresponded HTTP STATUS CODE

slugify: Slugifies any string passed including special characters

htmlEncode: Encode HTML characters

htmlDecode: Decode HTML special characters

readJson: Read json from file

dateFormat: format date to any format

toExcel: Convert given data in array to microsoft excel file

isFile: Check if a given path is a file

paginate: Automatically create pagination page values

isAjaxRequest: Check if request is an ajax request

Readme

Keywords

none

Package Sidebar

Install

npm i iyasunday

Weekly Downloads

25

Version

1.1.5

License

MIT

Unpacked Size

21.2 kB

Total Files

6

Last publish

Collaborators

  • mohemos