This code will extract the feature information of faces stored in the S3 bucket and store them in the piCollection that we created earlier using the AWS CLI tool.
Create a file with the name indexFaces.js and include the npm modules aws-sdk and fs in it. Make sure these modules are installed or run npm install command in the terminal to do the installation, as shown in Figure 7.28 and Figure 7.29:
In the indexFaces.js file, add both modules using require:
var AWS = require('aws-sdk'),fs = require('fs'); ...