@sparklings/reksadata
v0.1.1
Published
Indonesian mutual funds directory data
Downloads
192
Maintainers
Readme
@sparklings/reksadata
Indonesian mutual funds directory data - headless data package
A lightweight, type-safe npm package providing a complete directory of mutual funds (Reksa Dana) registered in Indonesia. Data is sourced from OJK (Otoritas Jasa Keuangan) and embedded directly in the package for offline usage.
Features
- 🚀 Zero dependencies - Pure data package
- 📦 Embedded data - Works offline, no API calls needed
- 🔒 Type-safe - Full TypeScript support
- 🎯 Headless - No UI, just data and utilities
- 🔍 Searchable - Helper functions for filtering and searching
Installation
npm install @sparklings/reksadata
# or
pnpm add @sparklings/reksadata
# or
yarn add @sparklings/reksadataUsage
Basic Usage
import { funds, metadata } from '@sparklings/reksadata'
console.log(`Total funds: ${metadata.count}`)
console.log(`Last updated: ${metadata.lastUpdated}`)
// Access all funds
funds.forEach(fund => {
console.log(`${fund.code}: ${fund.productName}`)
})Find by Code
import { findByCode } from '@sparklings/reksadata'
const fund = findByCode('BPAM001')
if (fund) {
console.log(fund.productName)
console.log(fund.investmentManager)
console.log(fund.fundType)
}Filter by Type
import { filterByType } from '@sparklings/reksadata'
const equityFunds = filterByType('equity_fund')
console.log(`Found ${equityFunds.length} equity funds`)Filter by Investment Manager
import { filterByManager } from '@sparklings/reksadata'
const bniFunds = filterByManager('PT BNI Asset Management')
console.log(`BNI-AM manages ${bniFunds.length} funds`)Search by Name
import { searchByName } from '@sparklings/reksadata'
const results = searchByName('pendapatan')
console.log(`Found ${results.length} funds matching "pendapatan"`)Get Unique Values
import { getFundTypes, getInvestmentManagers } from '@sparklings/reksadata'
const types = getFundTypes()
console.log('Available fund types:', types)
const managers = getInvestmentManagers()
console.log(`Total investment managers: ${managers.length}`)Data Structure
Fund Type
interface Fund {
code: string // Fund code (e.g., "BPAM001")
productName: string // Fund name
investmentManager: string // Investment manager name
fundType: FundType // Fund category
}Fund Types
Fund types available in the dataset:
capital_protected_fundmixed_asset_fundfixed_income_fundmoney_market_fundequity_fundindex_fundexchanged_traded_fundsukuk_based_fundglobal_fundrd_-_terproteksird_-_saham
API Reference
Data Exports
funds: Fund[]- Array of all mutual fundsdata: FundsData- Full dataset with metadatametadata- Dataset metadata (count, lastUpdated, source)
Utility Functions
findByCode(code: string): Fund | undefined- Find fund by codefilterByType(fundType: FundType): Fund[]- Filter by fund typefilterByManager(investmentManager: string): Fund[]- Filter by investment managersearchByName(query: string): Fund[]- Search funds by name (case-insensitive)getFundTypes(): FundType[]- Get all unique fund typesgetInvestmentManagers(): string[]- Get all unique investment managers
TypeScript Types
import type { Fund, FundsData, FundType } from '@sparklings/reksadata'Data Source
Data is sourced from OJK (Otoritas Jasa Keuangan), Indonesia's financial services authority.
Raw Data
If you need the raw CSV data, it's available in the GitHub repository.
Updates
This package is updated manually when new mutual funds are registered or fund information changes. Check the metadata.lastUpdated field for the last update timestamp.
License
MIT
Related Projects
For a web-based directory with search UI, see the companion static site project (link TBD).
