Node.js run main if called directly; don't if require'd

I have a node module that I would like to be callable as a standalone function and also as a library. If called standalone it needs to parse command line arguments and such. If required it needs to, well, not. Can a node file tell how it's called, and if called directly from node <file>, execute a different code path than if required?