MCPcopy Index your code
hub / github.com/nodejs/node / get_version

Function get_version

tools/getmoduleversion.py:6–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def get_version():
7 node_version_h = os.path.join(
8 os.path.dirname(__file__),
9 '..',
10 'src',
11 'node_version.h')
12
13 f = open(node_version_h)
14
15 regex = '^#define NODE_MODULE_VERSION [0-9]+'
16
17 for line in f:
18 if re.match(regex, line):
19 major = line.split()[2]
20 return major
21
22 raise Exception('Could not find pattern matching %s' % regex)
23
24
25if __name__ == '__main__':

Callers 1

Calls 4

matchMethod · 0.65
openFunction · 0.50
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…