function umask() {
	var options;
	var nargs;
	var mask;
	var opts;
	var arg;

	nargs = arguments.length;
	if ( nargs === 0 ) {
		return proc.umask();
	}
	opts = {};
	arg = arguments[ 0 ];
	if ( nargs === 1 ) {
		if ( isString( arg ) ) {
			mask = fromSymbolic( proc.umask(), arg );
			if ( mask instanceof Error ) {
				throw mask;
			}
			return proc.umask( mask );
		}
		if ( isNonNegativeInteger( arg ) ) {
			// Easy case where we use the built-in function to set the mask and return its return value:
			return proc.umask( arg );
		}
		if ( isObject( arg ) ) {
			if ( hasOwnProp( arg, 'symbolic' ) ) {
				opts.symbolic = arg.symbolic;
				if ( !isBoolean( opts.symbolic ) ) {
					throw new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'symbolic', opts.symbolic ) );
				}
			}
			mask = proc.umask();
			if ( opts.symbolic ) {
				mask = toSymbolic( mask );
			}
			return mask;
		}
		throw new TypeError( format( 'invalid argument. Must provide either a string, nonnegative integer, or an options object. Value: `%s`.', arg ) );
	}
	options = arguments[ 1 ];
	if ( !isObject( options ) ) {
		throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'symbolic' ) ) {
		opts.symbolic = options.symbolic;
		if ( !isBoolean( opts.symbolic ) ) {
			throw new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'symbolic', opts.symbolic ) );
		}
	}
	if ( isString( arg ) ) {
		mask = fromSymbolic( proc.umask(), arg );
		if ( mask instanceof Error ) {
			throw mask;
		}
	} else if ( isNonNegativeInteger( arg ) ) {
		mask = arg;
	} else {
		throw new TypeError( format( 'invalid argument. First argument must be either a string or nonnegative integer. Value: `%s`.', arg ) );
	}
	// Set the mask:
	mask = proc.umask( mask );

	// Determine how to format the output value:
	if ( opts.symbolic ) {
		mask = toSymbolic( mask );
	}
	return mask;
}
Get/set the process mask.

## Notes

-   If provided a mask, the function sets the current mask and returns the previous process mask. Otherwise, the function returns the current process mask.

@param {(NonNegativeInteger|string)} [mask] - mask
@param {Object} [options] - options
@param {boolean} [options.symbolic] - boolean indicating whether to return a mask using symbolic notation
@throws {TypeError} must provide either a string, nonnegative integer, or an options object
@throws {TypeError} must provide valid options
@throws {Error} must provide a parseable expression mask
@returns {(NonNegativeInteger|string)} process mask

@example
var mask = umask();
// returns <number>