
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vedic-astrology-api
Advanced tools
Node.js API for Vedic astrology calculations including Rasi, Nakshatra, Lagna and Birth Chart
A comprehensive Node.js API for Vedic astrology calculations including Rasi, Nakshatra, Lagna, Birth Chart, Porutham compatibility, and Behavior predictions based on ancient Indian astrological principles.
Step 1: Install the package
npm install vedic-astrology-api
Step 2: Import it in your project
const { BirthChartGenerator } = require('vedic-astrology-api/lib/utils/birthchart');
const { BirthChartGenerator, calculatePlanetaryPositions, calculateAscendant, createDate } = require('vedic-astrology-api/lib/utils');
// Create instance
const birthChartGenerator = new BirthChartGenerator();
// Create date
const date = createDate(1990, 5, 15, 10, 30, 5.5);
// Get planetary positions
const { positions, ayanamsa } = calculatePlanetaryPositions(date, 13.0827, 80.2707);
const ascendant = calculateAscendant(date, 13.0827, 80.2707);
// Generate chart
const birthChart = birthChartGenerator.generateBirthChart(positions, ascendant);
console.log('Houses:', birthChart.houses);
console.log('Planets:', birthChart.planets);
const { ImprovedNavamsaChart } = require('vedic-astrology-api/lib/utils/navamsachart');
const navamsaCalculator = new ImprovedNavamsaChart();
const navamsaChart = navamsaCalculator.generateNavamsaChart(
Object.fromEntries(Object.entries(positions).map(([planet, data]) => [planet, data.longitude])),
ayanamsa,
ascendant,
{
date: '1990-05-15',
time: '10:30',
latitude: 13.0827,
longitude: 80.2707,
timezone: 5.5
}
);
console.log('Navamsa Chart:', navamsaChart);
const { AccuratePoruthamCalculator } = require('vedic-astrology-api/lib/utils/porutham');
const poruthamCalculator = new AccuratePoruthamCalculator();
const person1Data = {
name: 'John',
gender: 'male',
date: new Date('1990-05-15T10:30:00'),
latitude: 13.0827,
longitude: 80.2707
};
const person2Data = {
name: 'Jane',
gender: 'female',
date: new Date('1992-08-22T14:45:00'),
latitude: 12.9716,
longitude: 77.5946
};
// Simplified
const simple = await poruthamCalculator.getSimplifiedCompatibility(person1Data, person2Data);
console.log('Compatibility %:', simple.compatibility.percentage);
// Detailed
const detailed = await poruthamCalculator.calculatePortuthamWithValidation(person1Data, person2Data);
console.log('Porutham Details:', detailed.poruthams);
const { BehaviorPredictor } = require('vedic-astrology-api/lib/utils/behaviorPredictor');
const behaviorPredictor = new BehaviorPredictor();
const behavior = behaviorPredictor.generateBehaviorPredictions(
birthChart,
{
ayanamsa,
ascendant,
rawPositions: Object.fromEntries(Object.entries(positions).map(([planet, data]) => [planet, data.longitude]))
},
ascendant,
{
birthDateTime: date.toISOString(),
coordinates: { latitude: 13.0827, longitude: 80.2707 },
timezone: 5.5
}
);
console.log('Behavior Predictions:', behavior);
const { getRashiFromLongitude, getNakshatraFromLongitude, validateInput } = require('vedic-astrology-api/lib/utils/common');
const moonLongitude = positions.Moon.longitude;
console.log('Moon Rashi:', getRashiFromLongitude(moonLongitude));
console.log('Moon Nakshatra:', getNakshatraFromLongitude(moonLongitude));
console.log('Lagna:', getRashiFromLongitude(ascendant));
// Validate
const errors = validateInput({
year: 1990,
month: 5,
day: 15,
hour: 10,
minute: 30,
latitude: 13.0827,
longitude: 80.2707,
timezone: 5.5
});
if (errors.length > 0) console.error(errors);
const {
BirthChartGenerator,
ImprovedNavamsaChart,
AccuratePoruthamCalculator,
BehaviorPredictor,
calculatePlanetaryPositions,
calculateAscendant,
createDate,
validateInput
} = require('vedic-astrology-api/lib/utils');
class CustomAstrologyService {
constructor() {
this.birthChartGenerator = new BirthChartGenerator();
this.navamsaCalculator = new ImprovedNavamsaChart();
this.poruthamCalculator = new AccuratePoruthamCalculator();
this.behaviorPredictor = new BehaviorPredictor();
}
async generateCompleteReport(birthData) {
const errors = validateInput(birthData);
if (errors.length > 0) throw new Error(errors.join(', '));
const date = createDate(
birthData.year,
birthData.month,
birthData.day,
birthData.hour,
birthData.minute,
birthData.timezone
);
const { positions, ayanamsa } = calculatePlanetaryPositions(date, birthData.latitude, birthData.longitude);
const ascendant = calculateAscendant(date, birthData.latitude, birthData.longitude);
return {
birthChart: this.birthChartGenerator.generateBirthChart(positions, ascendant),
navamsaChart: this.navamsaCalculator.generateNavamsaChart(
Object.fromEntries(Object.entries(positions).map(([planet, data]) => [planet, data.longitude])),
ayanamsa,
ascendant,
{
date: `${birthData.year}-${birthData.month}-${birthData.day}`,
time: `${birthData.hour}:${birthData.minute}`,
latitude: birthData.latitude,
longitude: birthData.longitude,
timezone: birthData.timezone
}
),
behaviorPredictions: this.behaviorPredictor.generateBehaviorPredictions(
this.birthChartGenerator.generateBirthChart(positions, ascendant),
{
ayanamsa,
ascendant,
rawPositions: Object.fromEntries(Object.entries(positions).map(([planet, data]) => [planet, data.longitude]))
},
ascendant,
{
birthDateTime: date.toISOString(),
coordinates: { latitude: birthData.latitude, longitude: birthData.longitude },
timezone: birthData.timezone
}
),
planetaryPositions: positions,
ayanamsa,
ascendant
};
}
}
const astrologyService = new CustomAstrologyService();
const report = await astrologyService.generateCompleteReport({
year: 1990,
month: 5,
day: 15,
hour: 10,
minute: 30,
latitude: 13.0827,
longitude: 80.2707,
timezone: 5.5
});
FAQs
Node.js API for Vedic astrology calculations including Rasi, Nakshatra, Lagna and Birth Chart
The npm package vedic-astrology-api receives a total of 37 weekly downloads. As such, vedic-astrology-api popularity was classified as not popular.
We found that vedic-astrology-api 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.