Module to parse xbrl documents and output json.
npm install parse-xbrlModule to parse xbrl documents and output json.
```
Dependency: npm install --save parse-xbrl
Dev Dependency: npm install --save-dev parse-xbrl
###### Example usage:
`
var ParseXbrl = require('parse-xbrl');
// path to locally accessible file, does not load file over http/https
ParseXbrl.parse('./test/sampleXbrlDocuments/amazon_10k.xml').then(function(parsedDoc) {
// Use results...
});
// string of correctly formatted xml/xbrl
ParseXbrl.parseStr('
// Use results...
});
`
###### Example output for Amazon's 10k (annual) statement:
```
{
EntityRegistrantName: 'AMAZON COM INC',
CurrentFiscalYearEndDate: '--12-31',
EntityCentralIndexKey: '0001018724',
EntityFilerCategory: 'Large Accelerated Filer',
TradingSymbol: 'AMZN',
DocumentPeriodEndDate: '2015-12-31',
DocumentFiscalYearFocus: '2015',
DocumentFiscalPeriodFocus: 'FY',
DocumentFiscalYearFocusContext: 'FD2015Q4YTD',
DocumentFiscalPeriodFocusContext: 'FD2015Q4YTD',
DocumentType: '10-K',
BalanceSheetDate: '2015-12-31',
IncomeStatementPeriodYTD: '2015-01-01',
ContextForInstants: 'FI2015Q4',
ContextForDurations: 'FD2015Q4YTD',
Assets: 65444000000,
CurrentAssets: 36474000000,
NoncurrentAssets: 28970000000,
LiabilitiesAndEquity: 65444000000,
Liabilities: 52060000000,
CurrentLiabilities: 33899000000,
NoncurrentLiabilities: 18161000000,
CommitmentsAndContingencies: 0,
TemporaryEquity: 0,
Equity: 13384000000,
EquityAttributableToNoncontrollingInterest: 0,
EquityAttributableToParent: 13384000000,
Revenues: 107006000000,
CostOfRevenue: 71651000000,
GrossProfit: 35355000000,
OperatingExpenses: 33122000000,
CostsAndExpenses: 104773000000,
OtherOperatingIncome: 0,
OperatingIncomeLoss: 2233000000,
NonoperatingIncomeLoss: -665000000,
InterestAndDebtExpense: 0,
IncomeBeforeEquityMethodInvestments: 1568000000,
IncomeFromEquityMethodInvestments: -22000000,
IncomeFromContinuingOperationsBeforeTax: 1568000000,
IncomeTaxExpenseBenefit: 950000000,
IncomeFromContinuingOperationsAfterTax: 596000000,
IncomeFromDiscontinuedOperations: 0,
ExtraordaryItemsGainLoss: 0,
NetIncomeLoss: 596000000,
NetIncomeAvailableToCommonStockholdersBasic: 596000000,
PreferredStockDividendsAndOtherAdjustments: 0,
NetIncomeAttributableToNoncontrollingInterest: 0,
NetIncomeAttributableToParent: 596000000,
OtherComprehensiveIncome: -212000000,
ComprehensiveIncome: 384000000,
ComprehensiveIncomeAttributableToParent: 384000000,
ComprehensiveIncomeAttributableToNoncontrollingInterest: 0,
NonoperatingIncomeLossPlusInterestAndDebtExpense: -665000000,
NonoperatingIncomePlusInterestAndDebtExpensePlusIncomeFromEquityMethodInvestments: -665000000,
NetCashFlow: 1333000000,
NetCashFlowsOperating: 11920000000,
NetCashFlowsInvesting: -6450000000,
NetCashFlowsFinancing: -3763000000,
NetCashFlowsOperatingContinuing: 11920000000,
NetCashFlowsInvestingContinuing: -6450000000,
NetCashFlowsFinancingContinuing: -3763000000,
NetCashFlowsOperatingDiscontinued: 0,
NetCashFlowsInvestingDiscontinued: 0,
NetCashFlowsFinancingDiscontinued: 0,
NetCashFlowsDiscontinued: 0,
ExchangeGainsLosses: -374000000,
NetCashFlowsContinuing: 1707000000,
SGR: 0.046606193306224585,
ROA: 0.009107022798117474,
ROE: 0.04453078302450687,
ROS: 0.0055697811337682
}
MIT