Observed since 20 Oct, 22:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A collection of utility functions
A collection of utility functions for various common tasks, including formatting values, handling dates, and interacting with web3.
To install the package, use npm:
npm install @0x1luxa/utils
Formats a number to a USD currency string.
import { formatUsdValue } from "@0x1luxa/utils"
const formattedValue = formatUsdValue(1234.56)
console.log(formattedValue) // "$1,234.56"
Formats a number to a percentage string.
import { formatPercentValue } from "@0x1luxa/utils"
const formattedPercent = formatPercentValue(0.1234)
console.log(formattedPercent) // "12.34%"
Calculates how many days ago a given date was.
import { getDaysAgo } from "@0x1luxa/utils"
const daysAgo = getDaysAgo("2023-01-01")
console.log(daysAgo) // e.g., "9 months ago"
Shortens an Ethereum address for display purposes.
import { shortenAddress } from "@0x1luxa/utils"
const shortAddress = shortenAddress(
"0x1234567890abcdef1234567890abcdef12345678"
)
console.log(shortAddress) // "0x1234...5678"
Parses an RPC error to extract useful information.
import { parseRpcError } from "@0x1luxa/utils"
const error = new Error("Transaction reverted")
const parsedError = parseRpcError(error)
console.log(parsedError.revertReason) // "Transaction reverted"
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.22Registry latest | 20 Mar 2025 | 6 | |
| 0.2.20 | 20 Mar 2025 | 6 | |
| 0.2.19 | 20 Mar 2025 | 6 | |
| 0.2.18 | 20 Mar 2025 | 6 | |
| 0.2.17 | 20 Mar 2025 | 6 | |
| 0.2.16 | 20 Mar 2025 | 6 | |
| 0.2.15 | 20 Mar 2025 | 6 | |
| 0.2.14 | 20 Mar 2025 | 6 | |
| 0.2.13 | 19 Mar 2025 | 6 | |
| 0.2.12 | 19 Mar 2025 | 6 | |
| 0.2.11 | 19 Mar 2025 | 6 | |
| 0.2.10 | 19 Mar 2025 | 6 | |
| 0.2.9 | 19 Mar 2025 | 6 | |
| 0.2.8 | 19 Mar 2025 | 5 | |
| 0.2.7 | 19 Mar 2025 | 5 | |
| 0.2.6 | 19 Mar 2025 | 5 | |
| 0.2.5 | 19 Mar 2025 | 5 | |
| 0.2.4 | 19 Mar 2025 | 5 | |
| 0.2.3 | 19 Mar 2025 | 5 | |
| 0.2.2 | 19 Mar 2025 | 5 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:07ee5719d80f76a77fd5d58295c71ad42e99911f15ca16c2664f009050304afa