
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Easily fetch Indian Mutual Fund data like NAV, scheme info, and historical records through a simple Node.js API client
A lightweight Node.js and TypeScript utility for fetching Indian Mutual Fund data from mfapi.in, including scheme details, NAVs, and historical data.
npm install mf-tool
import { MfTool } from 'mf-tool';
// Initialize the tool
const mfTool = new MfTool();
// Example: Search for a mutual fund scheme
async function findScheme() {
const schemes = await mfTool.findSchemaCodeReference('SBI Blue Chip');
console.log(schemes);
}
// Example: Get NAV details for a specific scheme
async function getNavDetails() {
const navDetails = await mfTool.getFundNavDetails('123456');
console.log(navDetails);
}
new MfTool()Creates a new instance of the MF Tool.
updateSchemaCodes(forcePull?: boolean): Promise<void>Updates the local cache of mutual fund scheme codes.
| Parameter | Type | Default | Description |
|---|---|---|---|
| forcePull | boolean | false | When true, ignores local cache and fetches fresh data from API |
findSchemaCodeReference(userInput: string): Promise<SchemaCodeReference[]>Searches for mutual fund schemes that match the input string.
| Parameter | Type | Description |
|---|---|---|
| userInput | string | Search term for mutual fund scheme names |
Returns: Array of matching SchemaCodeReference objects
getAllSchemaCodeReference(): Promise<SchemaCodeReference[]>Retrieves all available mutual fund schemes.
Returns: Array of all SchemaCodeReference objects
getFundNavDetails(schemaCode: string, needHistoric?: boolean): Promise<NavDetails>Fetches NAV details for a specific mutual fund scheme.
| Parameter | Type | Default | Description |
|---|---|---|---|
| schemaCode | string | The unique code of the mutual fund scheme | |
| needHistoric | boolean | false | When true, includes historical NAV data |
Returns: NavDetails object containing the NAV information
import { MfTool } from 'indian-mf-tool';
async function searchFund() {
const mfTool = new MfTool();
// Search for HDFC funds
const hdcpFunds = await mfTool.findSchemaCodeReference('HDFC');
// Print the first 5 results
console.log(hdcpFunds.slice(0, 5));
}
searchFund();
import { MfTool } from 'indian-mf-tool';
async function getNavInfo() {
const mfTool = new MfTool();
// First find the scheme code
const schemes = await mfTool.findSchemaCodeReference('Axis Bluechip Fund');
if (schemes.length > 0) {
// Get NAV details for the first matching scheme
const navDetails = await mfTool.getFundNavDetails(schemes[0].schemaCode);
console.log(`Latest NAV: ${navDetails.data.nav}`);
console.log(`Date: ${navDetails.data.date}`);
}
}
getNavInfo();
import { MfTool } from 'indian-mf-tool';
async function getHistoricalNav() {
const mfTool = new MfTool();
// Get scheme with historical data
const schemeCode = '119551'; // Example scheme code
const navDetails = await mfTool.getFundNavDetails(schemeCode, true);
// Access historical data
const historicalData = navDetails.data.navHistory;
console.log(historicalData);
}
getHistoricalNav();
interface SchemaCodeReference {
schemaCode: string;
schemeName: string;
}
import { MfTool } from 'indian-mf-tool';
async function handleErrors() {
const mfTool = new MfTool();
try {
// Using an invalid scheme code
const navDetails = await mfTool.getFundNavDetails('invalid-code');
console.log(navDetails);
} catch (error) {
console.error('Error fetching NAV details:', error.message);
}
}
handleErrors();
Contributions are welcome! Feel free to open issues or submit pull requests on our GitHub repository.
MIT License - see the LICENSE file for details.
FAQs
Easily fetch Indian Mutual Fund data like NAV, scheme info, and historical records through a simple Node.js API client
We found that mf-tool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.