It is part of an Attack action
The description of the javelin of lightning says (emphasis mine):
This javelin is a magic weapon. When you hurl it and speak its command word, it transforms into a bolt of lightning, forming a line 5 feet wide that extends out from you to a target within 120 feet. [...] The lightning bolt turns back into a javelin when it reaches the target. Make a ranged weapon attack against the target. On a hit, the target takes damage from the javelin plus 4d6 lightning damage.
The javelin's property can't be used again until the next dawn. In the meantime, the javelin can still be used as a magic weapon.
This seems a little ambiguous at first. The special ability of the javelin is essentially a way for it to do damage to the primary target and other creatures along the way, but it still involves a ranged weapon attack against that primary target - and the way you do that is to "hurl" the weapon (i.e. throw it). Thus, it seems reasonable to interpret it as a single weapon attack made as part of the Attack action, since nothing in the item's description says otherwise - you're simply attacking as normal, and saying a command word to activate its special ability when you do so.
Rules designer Jeremy Crawford unofficially confirms this interpretation on Twitter:
When using the special ability of Javelin of Lightning does the attack have disadvantage if target is outside normal range for a standard javelin rwa? Is this ability part of an Attack Action or some kind of magic item activation? RAI>RAW if they differ.
The attack portion of the javelin of lightning follows the normal rules for an attack with a javelin, and it can be done as part of the Attack action.
In short, it's a single attack within the Attack action, and follows the corresponding rules. Essentially, you throw it as you would any javelin as part of an Attack action, you potentially speak its command word to transform it into a bolt of lightning as it flies through the air, and then it turns back into a javelin as it hits the target (doing extra damage if you activated its special ability).
This magic javelin's description does note: "The javelin's property can't be used again until the next dawn." So if you had multiple javelins of lightning somehow and you had the Extra Attack feature, you could theoretically throw multiple ones in a single turn, but you'd be using up both javelins' ability to be used in this way for the day. (Not to mention that you'd have to have at least one of the javelins already drawn at the start of the turn, since you'd use your one free object interaction for the turn to draw a javelin.)