Light Dependent Resistor
An LDR is a resistor that varies resistance with the amount of light shining on it. The GL5537 changes resistance from 25k in darkness to around 200 Ohms when lots of light shines on it.
Connect as follows:
|1st Pin||2nd pin||A1|
Note: any Analog pin will do.
You can then easily read the analog value. Because of the way the sensor is wired, the value you'll get will be near 0.5 in darkness, and 1 when there is a lot of light.
var light = analogRead(A1); console.log(light);